File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change 1- use clippy_utils:: diagnostics:: span_lint_and_then;
1+ use clippy_utils:: diagnostics:: { span_lint_and_help , span_lint_and_then} ;
22use clippy_utils:: source:: snippet_opt;
33use clippy_utils:: ty:: implements_trait;
44use rustc_hir:: { ExprKind , UnOp } ;
@@ -98,19 +98,16 @@ impl LateLintPass<'_> for NeedlessDeref {
9898 }
9999 ) ;
100100 } else {
101- span_lint_and_then (
101+ span_lint_and_help (
102102 cx,
103103 NEEDLESS_DEREF ,
104104 e. span,
105105 "deref on an immutable reference" ,
106- |diag| {
107- diag. help(
108- & format!(
109- "consider using `{}` if you would like to reborrow" ,
110- & snippet_opt( cx, deref_expr. span) . unwrap( ) ,
111- )
112- ) ;
113- }
106+ None ,
107+ & format!(
108+ "consider using `{}` if you would like to reborrow" ,
109+ & snippet_opt( cx, deref_expr. span) . unwrap( ) ,
110+ )
114111 ) ;
115112 }
116113
You can’t perform that action at this time.
0 commit comments