diff options
| author | Glenn Hope <glenn.alexander.hope@gmail.com> | 2020-05-09 10:16:47 -0700 |
|---|---|---|
| committer | Glenn Hope <glenn.alexander.hope@gmail.com> | 2020-05-09 11:10:16 -0700 |
| commit | b69200b8468434bc3f5b9ef8468733e5d40f4e01 (patch) | |
| tree | 4bc49392faaa2f5b2ae8a236ff28a0b5637a0869 | |
| parent | 0ba61c612ee873314d252ca1f747c14a2f0161ba (diff) | |
| download | rust-b69200b8468434bc3f5b9ef8468733e5d40f4e01.tar.gz rust-b69200b8468434bc3f5b9ef8468733e5d40f4e01.zip | |
Move is_test_module check to top of function
| -rw-r--r-- | clippy_lints/src/wildcard_imports.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clippy_lints/src/wildcard_imports.rs b/clippy_lints/src/wildcard_imports.rs index 2c4e24780e7..32d9a45c37d 100644 --- a/clippy_lints/src/wildcard_imports.rs +++ b/clippy_lints/src/wildcard_imports.rs @@ -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); |
