@@ -65,28 +65,24 @@ declare_lint_pass!(HashMapPass => [MAP_ENTRY]);
6565impl < ' tcx > LateLintPass < ' tcx > for HashMapPass {
6666 #[ expect( clippy:: too_many_lines) ]
6767 fn check_expr ( & mut self , cx : & LateContext < ' tcx > , expr : & ' tcx Expr < ' _ > ) {
68- let ( cond_expr, then_expr, else_expr) = match higher:: If :: hir ( expr) {
69- Some ( higher:: If { cond, then, r#else } ) => ( cond, then, r#else) ,
70- _ => return ,
68+ let Some ( higher:: If { cond : cond_expr, then : then_expr, r#else : else_expr } ) = higher:: If :: hir ( expr) else {
69+ return
7170 } ;
7271
73- let ( map_ty, contains_expr) = match try_parse_contains ( cx, cond_expr) {
74- Some ( x) => x,
75- None => return ,
72+ let Some ( ( map_ty, contains_expr) ) = try_parse_contains ( cx, cond_expr) else {
73+ return
7674 } ;
7775
78- let then_search = match find_insert_calls ( cx, & contains_expr, then_expr) {
79- Some ( x) => x,
80- None => return ,
76+ let Some ( then_search) = find_insert_calls ( cx, & contains_expr, then_expr) else {
77+ return
8178 } ;
8279
8380 let mut app = Applicability :: MachineApplicable ;
8481 let map_str = snippet_with_context ( cx, contains_expr. map . span , contains_expr. call_ctxt , ".." , & mut app) . 0 ;
8582 let key_str = snippet_with_context ( cx, contains_expr. key . span , contains_expr. call_ctxt , ".." , & mut app) . 0 ;
8683 let sugg = if let Some ( else_expr) = else_expr {
87- let else_search = match find_insert_calls ( cx, & contains_expr, else_expr) {
88- Some ( search) => search,
89- None => return ,
84+ let Some ( else_search) = find_insert_calls ( cx, & contains_expr, else_expr) else {
85+ return ;
9086 } ;
9187
9288 if then_search. edits . is_empty ( ) && else_search. edits . is_empty ( ) {
0 commit comments