Skip to content

Commit 478d159

Browse files
committed
fix dogfood lints in redundant_local
1 parent 4635efd commit 478d159

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

clippy_lints/src/redundant_local.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
use clippy_utils::diagnostics::span_lint_and_help;
2-
use rustc_ast::{ast::*, visit::FnKind};
2+
use rustc_ast::{
3+
ast::{BindingAnnotation, Block, Expr, ExprKind, LocalKind, Mutability, Pat, PatKind, Path, StmtKind},
4+
visit::FnKind,
5+
};
36
use rustc_data_structures::fx::FxHashMap;
47
use rustc_lint::{EarlyContext, EarlyLintPass};
58
use rustc_session::{declare_lint_pass, declare_tool_lint};
@@ -53,7 +56,7 @@ impl EarlyLintPass for RedundantLocal {
5356
kind: ExprKind::Block(block, _),
5457
..
5558
},
56-
) => &block,
59+
) => block,
5760
_ => return,
5861
};
5962

@@ -95,7 +98,7 @@ fn check_block_with_bindings(cx: &EarlyContext<'_>, bindings: &mut FxHashMap<Ide
9598
vec![prev.definition_span, local.span],
9699
"redundant redefinition of a binding",
97100
None,
98-
&format!("remove the redefinition of `{}`", ident),
101+
&format!("remove the redefinition of `{ident}`"),
99102
);
100103
}
101104
}
@@ -118,5 +121,5 @@ fn collect_introduced_bindings(bindings: &mut FxHashMap<Ident, BindingInfo>, pat
118121
);
119122
}
120123
true
121-
})
124+
});
122125
}

0 commit comments

Comments
 (0)