@@ -1110,27 +1110,26 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
11101110 }
11111111 }
11121112
1113- // Returns whether the given expression is a destruct assignment desugaring.
1114- // For example, `(a, b) = (1, &2);`
1115- // Here we try to find the pattern binding of the expression,
1116- // `default_binding_modes` is false only for destruct assignment desugaring.
1113+ /// Returns whether the given expression is a destruct assignment desugaring.
1114+ /// For example, `(a, b) = (1, &2);`
1115+ /// Here we try to find the pattern binding of the expression,
1116+ /// `default_binding_modes` is false only for destruct assignment desugaring.
11171117 pub ( crate ) fn is_destruct_assignment_desugaring ( & self , expr : & hir:: Expr < ' _ > ) -> bool {
11181118 if let hir:: ExprKind :: Path ( hir:: QPath :: Resolved (
11191119 _,
11201120 hir:: Path { res : hir:: def:: Res :: Local ( bind_hir_id) , .. } ,
11211121 ) ) = expr. kind
1122- {
1123- let bind = self . tcx . hir_node ( * bind_hir_id) ;
1124- let parent = self . tcx . parent_hir_node ( * bind_hir_id) ;
1125- if let hir:: Node :: Pat ( hir:: Pat {
1122+ && let bind = self . tcx . hir_node ( * bind_hir_id)
1123+ && let parent = self . tcx . parent_hir_node ( * bind_hir_id)
1124+ && let hir:: Node :: Pat ( hir:: Pat {
11261125 kind : hir:: PatKind :: Binding ( _, _hir_id, _, _) , ..
11271126 } ) = bind
1128- && let hir:: Node :: Pat ( hir:: Pat { default_binding_modes : false , .. } ) = parent
1129- {
1130- return true ;
1131- }
1127+ && let hir:: Node :: Pat ( hir:: Pat { default_binding_modes : false , .. } ) = parent
1128+ {
1129+ true
1130+ } else {
1131+ false
11321132 }
1133- false
11341133 }
11351134
11361135 fn explain_self_literal (
0 commit comments