Skip to content

Commit 598fcd1

Browse files
lengyijunxFrednet
andcommitted
Update clippy_lints/src/pathbuf_init_then_push.rs
Co-authored-by: Fridtjof Stoldt <[email protected]>
1 parent 218798b commit 598fcd1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/pathbuf_init_then_push.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ impl<'tcx> LateLintPass<'tcx> for PathbufThenPush<'tcx> {
151151
}
152152

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

0 commit comments

Comments
 (0)