Skip to content

Commit 4c3e2ff

Browse files
committed
Fix header
1 parent ba0e7e8 commit 4c3e2ff

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

clippy_lints/src/wildcard_imports.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,30 +102,22 @@ declare_clippy_lint! {
102102
pub struct WildcardImports {
103103
warn_on_all: bool,
104104
test_modules_deep: u32,
105-
ignore: bool,
106105
}
107106

108107
impl WildcardImports {
109108
pub fn new(warn_on_all: bool) -> Self {
110109
Self {
111110
warn_on_all,
112111
test_modules_deep: 0,
113-
ignore: false,
114112
}
115113
}
116114
}
117115

118116
impl_lint_pass!(WildcardImports => [ENUM_GLOB_USE, WILDCARD_IMPORTS]);
119117

120118
impl LateLintPass<'_> for WildcardImports {
121-
fn check_crate(&mut self, cx: &LateContext<'_>) {
122-
if cx.sess().opts.test {
123-
self.ignore = true;
124-
}
125-
}
126-
127119
fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) {
128-
if self.ignore {
120+
if cx.sess().is_test_crate() {
129121
return;
130122
}
131123

tests/ui/wildcard_imports_cfgtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --test
1+
//@compile-flags: --test
22

33
#![warn(clippy::wildcard_imports)]
44
#![allow(unused, clippy::unnecessary_wraps, clippy::let_unit_value)]

0 commit comments

Comments
 (0)