We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
is_mutable
needs_to_be_mutable
1 parent 563a009 commit fc239fdCopy full SHA for fc239fd
clippy_lints/src/methods/map_identity.rs
@@ -27,9 +27,8 @@ pub(super) fn check(
27
let mut sugg = vec![(call_span, String::new())];
28
let mut app = Applicability::MachineApplicable;
29
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() {
+ let needs_to_be_mutable = cx.typeck_results().expr_ty_adjusted(expr).is_mutable_ptr();
+ if needs_to_be_mutable && !is_mutable(cx, caller) {
33
if let Some(hir_id) = path_to_local_with_projections(caller)
34
&& let Node::Pat(pat) = cx.tcx.hir_node(hir_id)
35
&& let PatKind::Binding(_, _, ident, _) = pat.kind
0 commit comments