File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -48,14 +48,6 @@ pub(super) fn check(
4848 }
4949 }
5050
51- let method_requiring_mut = if let Node :: Expr ( expr) = cx. tcx . parent_hir_node ( expr. hir_id )
52- && let ExprKind :: MethodCall ( method, ..) = expr. kind
53- {
54- Some ( method. ident )
55- } else {
56- None
57- } ;
58-
5951 span_lint_and_then (
6052 cx,
6153 MAP_IDENTITY ,
@@ -65,8 +57,10 @@ pub(super) fn check(
6557 diag. multipart_suggestion ( msg, sugg, app) ;
6658
6759 if app != Applicability :: MachineApplicable {
68- let note = if let Some ( method_requiring_mut) = method_requiring_mut {
69- format ! ( "this must be made mutable to use `{method_requiring_mut}`" )
60+ let note = if let Node :: Expr ( expr) = cx. tcx . parent_hir_node ( expr. hir_id )
61+ && let ExprKind :: MethodCall ( method, ..) = expr. kind
62+ {
63+ format ! ( "this must be made mutable to use `{}`" , method. ident)
7064 } else {
7165 "this must be made mutable" . to_string ( )
7266 } ;
You can’t perform that action at this time.
0 commit comments