]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/needless_pass_by_value.rs
Auto merge of #68717 - petrochenkov:stabexpat, r=varkor
[rust.git] / clippy_lints / src / needless_pass_by_value.rs
index 200fd5656b4f708c64106cb28f20967a4f93714f..ed48ab548978c67811c7056c949e38007ca41743 100644 (file)
@@ -135,8 +135,7 @@ fn check_fn(
         } = {
             let mut ctx = MovedVariablesCtxt::default();
             cx.tcx.infer_ctxt().enter(|infcx| {
-                euv::ExprUseVisitor::new(&mut ctx, &infcx, fn_def_id.to_def_id(), cx.param_env, cx.tables)
-                    .consume_body(body);
+                euv::ExprUseVisitor::new(&mut ctx, &infcx, fn_def_id, cx.param_env, cx.tables).consume_body(body);
             });
             ctx
         };
@@ -294,7 +293,7 @@ fn check_fn(
                             );
                             spans.sort_by_key(|&(span, _)| span);
                         }
-                        multispan_sugg(diag, "consider taking a reference instead".to_string(), spans);
+                        multispan_sugg(diag, "consider taking a reference instead", spans);
                     };
 
                     span_lint_and_then(