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} ;
2
2
use clippy_utils:: source:: snippet_opt;
3
3
use clippy_utils:: ty:: implements_trait;
4
4
use rustc_hir:: { ExprKind , UnOp } ;
@@ -98,19 +98,16 @@ impl LateLintPass<'_> for NeedlessDeref {
98
98
}
99
99
) ;
100
100
} else {
101
- span_lint_and_then (
101
+ span_lint_and_help (
102
102
cx,
103
103
NEEDLESS_DEREF ,
104
104
e. span,
105
105
"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
+ )
114
111
) ;
115
112
}
116
113
You can’t perform that action at this time.
0 commit comments