Skip to content

Commit b69200b

Browse files
committed
Move is_test_module check to top of function
1 parent 0ba61c6 commit b69200b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/wildcard_imports.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ impl_lint_pass!(WildcardImports => [ENUM_GLOB_USE, WILDCARD_IMPORTS]);
9797

9898
impl LateLintPass<'_, '_> for WildcardImports {
9999
fn check_item(&mut self, cx: &LateContext<'_, '_>, item: &Item<'_>) {
100-
if item.vis.node.is_pub() || item.vis.node.is_pub_restricted() {
101-
return;
102-
}
103100
if is_test_module_or_function(item) {
104101
self.test_modules_deep = self.test_modules_deep.saturating_add(1);
105102
}
103+
if item.vis.node.is_pub() || item.vis.node.is_pub_restricted() {
104+
return;
105+
}
106106
if_chain! {
107107
if let ItemKind::Use(use_path, UseKind::Glob) = &item.kind;
108108
if self.warn_on_all || !self.check_exceptions(item, use_path.segments);

0 commit comments

Comments
 (0)