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 <xFrednet@gmail.com>
  • Loading branch information
lengyijun and xFrednet committed Jul 1, 2024
1 parent 218798b commit c7e4ef4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions clippy_lints/src/pathbuf_init_then_push.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +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()
&& let ExprKind::Assign(left, right, _) = expr.kind
if let ExprKind::Assign(left, right, _) = expr.kind
&& let ExprKind::Path(QPath::Resolved(None, path)) = left.kind
&& let [name] = &path.segments
&& let Res::Local(id) = path.res
Expand Down

0 comments on commit c7e4ef4

Please sign in to comment.