Skip to content

Commit fa7fe29

Browse files
committed
handled review
1 parent d9140bb commit fa7fe29

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

clippy_lints/src/rest_when_destructuring_struct.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ impl<'tcx> LateLintPass<'tcx> for RestWhenDestructuringStruct {
117117
}
118118

119119
// Filter out results from macros
120-
if (!needs_dotdot || !missing_suggestions.is_empty())
121-
&& pat.span.in_external_macro(cx.tcx.sess.source_map())
120+
if (missing_suggestions.is_empty() && needs_dotdot)
121+
|| pat.span.in_external_macro(cx.tcx.sess.source_map())
122122
|| is_from_proc_macro(cx, pat)
123123
{
124124
return;
@@ -152,9 +152,7 @@ impl<'tcx> LateLintPass<'tcx> for RestWhenDestructuringStruct {
152152
);
153153
},
154154
);
155-
}
156-
157-
if missing_suggestions.is_empty() && !needs_dotdot {
155+
} else if !needs_dotdot {
158156
let message = "consider removing the unnecessary rest pattern (`..`)";
159157
span_lint_and_then(
160158
cx,

0 commit comments

Comments
 (0)