mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-15 18:15:01 +00:00
Move is_test_module check to top of function
This commit is contained in:
parent
0ba61c612e
commit
b69200b846
@ -97,12 +97,12 @@ impl_lint_pass!(WildcardImports => [ENUM_GLOB_USE, WILDCARD_IMPORTS]);
|
||||
|
||||
impl LateLintPass<'_, '_> for WildcardImports {
|
||||
fn check_item(&mut self, cx: &LateContext<'_, '_>, item: &Item<'_>) {
|
||||
if item.vis.node.is_pub() || item.vis.node.is_pub_restricted() {
|
||||
return;
|
||||
}
|
||||
if is_test_module_or_function(item) {
|
||||
self.test_modules_deep = self.test_modules_deep.saturating_add(1);
|
||||
}
|
||||
if item.vis.node.is_pub() || item.vis.node.is_pub_restricted() {
|
||||
return;
|
||||
}
|
||||
if_chain! {
|
||||
if let ItemKind::Use(use_path, UseKind::Glob) = &item.kind;
|
||||
if self.warn_on_all || !self.check_exceptions(item, use_path.segments);
|
||||
|
Loading…
Reference in New Issue
Block a user