We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc5c048 commit 5a30b98Copy full SHA for 5a30b98
clippy_lints/src/stacked_if_match.rs
@@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint_and_sugg;
2
use clippy_utils::source::snippet;
3
use clippy_utils::visitors::{for_each_expr, Descend};
4
use rustc_errors::Applicability;
5
-use rustc_hir::*;
+use rustc_hir::{Expr, ExprKind, MatchSource};
6
use rustc_lint::{LateContext, LateLintPass, LintContext};
7
use rustc_middle::lint::in_external_macro;
8
use rustc_session::declare_lint_pass;
@@ -87,7 +87,7 @@ impl<'tcx> LateLintPass<'tcx> for StackedIfMatch {
87
STACKED_IF_MATCH,
88
expr.span.with_hi(sub_expr.span.hi()),
89
format!("avoid using `{keyword} {keyword}` by binding inner `{keyword}` with `let`"),
90
- format!("try"),
+ "try",
91
format!("let result = {inner_snippet}; {keyword} result"),
92
Applicability::MachineApplicable,
93
);
0 commit comments