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.
note
1 parent b4065d1 commit 56dd532Copy full SHA for 56dd532
clippy_lints/src/methods/map_identity.rs
@@ -63,14 +63,12 @@ pub(super) fn check(
63
},
64
);
65
if !apply {
66
- if let Some(method_requiring_mut) = method_requiring_mut {
67
- diag.span_note(
68
- caller.span,
69
- format!("this must be made mutable to use `{method_requiring_mut}`"),
70
- );
+ let note = if let Some(method_requiring_mut) = method_requiring_mut {
+ format!("this must be made mutable to use `{method_requiring_mut}`")
71
} else {
72
- diag.span_note(caller.span, "this must be made mutable".to_string());
73
- }
+ "this must be made mutable".to_string()
+ };
+ diag.span_note(caller.span, note);
74
}
75
76
0 commit comments