Move is_test_module check to top of function
This commit is contained in:
parent
0ba61c612e
commit
b69200b846
1 changed files with 3 additions and 3 deletions
|
@ -97,12 +97,12 @@ impl_lint_pass!(WildcardImports => [ENUM_GLOB_USE, WILDCARD_IMPORTS]);
|
||||||
|
|
||||||
impl LateLintPass<'_, '_> for WildcardImports {
|
impl LateLintPass<'_, '_> for WildcardImports {
|
||||||
fn check_item(&mut self, cx: &LateContext<'_, '_>, item: &Item<'_>) {
|
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) {
|
if is_test_module_or_function(item) {
|
||||||
self.test_modules_deep = self.test_modules_deep.saturating_add(1);
|
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_chain! {
|
||||||
if let ItemKind::Use(use_path, UseKind::Glob) = &item.kind;
|
if let ItemKind::Use(use_path, UseKind::Glob) = &item.kind;
|
||||||
if self.warn_on_all || !self.check_exceptions(item, use_path.segments);
|
if self.warn_on_all || !self.check_exceptions(item, use_path.segments);
|
||||||
|
|
Loading…
Add table
Reference in a new issue