Skip to content

Commit fc239fd

Browse files
committed
inline is_mutable, make needs_to_be_mutable non-lazy
1 parent 563a009 commit fc239fd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

clippy_lints/src/methods/map_identity.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ pub(super) fn check(
2727
let mut sugg = vec![(call_span, String::new())];
2828
let mut app = Applicability::MachineApplicable;
2929

30-
let needs_to_be_mutable = || cx.typeck_results().expr_ty_adjusted(expr).is_mutable_ptr();
31-
let is_mutable = || is_mutable(cx, caller);
32-
if needs_to_be_mutable() && !is_mutable() {
30+
let needs_to_be_mutable = cx.typeck_results().expr_ty_adjusted(expr).is_mutable_ptr();
31+
if needs_to_be_mutable && !is_mutable(cx, caller) {
3332
if let Some(hir_id) = path_to_local_with_projections(caller)
3433
&& let Node::Pat(pat) = cx.tcx.hir_node(hir_id)
3534
&& let PatKind::Binding(_, _, ident, _) = pat.kind

0 commit comments

Comments
 (0)