Skip to content

Commit

Permalink
Update clippy_lints/src/pathbuf_init_then_push.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Fridtjof Stoldt <[email protected]>
  • Loading branch information
lengyijun and xFrednet committed Jul 1, 2024
1 parent 218798b commit 598fcd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clippy_lints/src/pathbuf_init_then_push.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ impl<'tcx> LateLintPass<'tcx> for PathbufThenPush<'tcx> {
}

fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
if self.searcher.is_none()
if let Some(mut searcher) = self.searcher.take()
&& let ExprKind::Assign(left, right, _) = expr.kind
&& let ExprKind::Path(QPath::Resolved(None, path)) = left.kind
&& let [name] = &path.segments
Expand Down

0 comments on commit 598fcd1

Please sign in to comment.