Skip to content

Commit c68d9e7

Browse files
committed
fmt
1 parent bba1957 commit c68d9e7

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

clippy_lints/src/needless_deref.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use clippy_utils::diagnostics::span_lint_and_then;
1+
use clippy_utils::diagnostics::{span_lint_and_help, span_lint_and_then};
22
use clippy_utils::source::snippet_opt;
33
use clippy_utils::ty::implements_trait;
44
use 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

0 commit comments

Comments
 (0)