File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 1
1
use crate :: rustc_lint:: LintContext ;
2
- use clippy_utils:: diagnostics:: span_lint_and_sugg ;
2
+ use clippy_utils:: diagnostics:: span_lint_and_then ;
3
3
use clippy_utils:: source:: snippet_with_context;
4
4
use if_chain:: if_chain;
5
5
use rustc_errors:: Applicability ;
@@ -52,14 +52,19 @@ impl<'tcx> LateLintPass<'tcx> for SemicolonIfNothingReturned {
52
52
if let ExprKind :: DropTemps ( ..) = & expr. kind {
53
53
return ;
54
54
}
55
- span_lint_and_sugg (
55
+ span_lint_and_then (
56
56
cx,
57
57
SEMICOLON_IF_NOTHING_RETURNED ,
58
58
expr. span. source_callsite( ) ,
59
59
"consider adding a `;` to the last statement for consistent formatting" ,
60
- "add a `;` here" ,
61
- format!( "{snippet};" ) ,
62
- app,
60
+ |diag| {
61
+ diag. span_suggestion(
62
+ expr. span,
63
+ "add a `;` here" ,
64
+ format!( "{snippet};" ) ,
65
+ Applicability :: MachineApplicable ,
66
+ ) ;
67
+ }
63
68
) ;
64
69
}
65
70
}
You can’t perform that action at this time.
0 commit comments