Skip to content

Commit 0449954

Browse files
committed
use in eager_transmute
1 parent 1eafa11 commit 0449954

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

clippy_lints/src/transmute/eager_transmute.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use clippy_utils::diagnostics::span_lint_and_then;
2-
use clippy_utils::{eq_expr_value, path_to_local, sym};
2+
use clippy_utils::{eq_expr_value, path_to_local_with_projections, sym};
33
use rustc_abi::WrappingRange;
44
use rustc_errors::Applicability;
55
use rustc_hir::{Expr, ExprKind, Node};
@@ -63,11 +63,7 @@ fn binops_with_local(cx: &LateContext<'_>, local_expr: &Expr<'_>, expr: &Expr<'_
6363
/// Checks if an expression is a path to a local variable (with optional projections), e.g.
6464
/// `x.field[0].field2` would return true.
6565
fn is_local_with_projections(expr: &Expr<'_>) -> bool {
66-
match expr.kind {
67-
ExprKind::Path(_) => path_to_local(expr).is_some(),
68-
ExprKind::Field(expr, _) | ExprKind::Index(expr, ..) => is_local_with_projections(expr),
69-
_ => false,
70-
}
66+
path_to_local_with_projections(expr).is_some()
7167
}
7268

7369
pub(super) fn check<'tcx>(

0 commit comments

Comments
 (0)