Skip to content

Commit 422c07c

Browse files
committed
Use more elegant way to check for prelude string
1 parent f202810 commit 422c07c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/wildcard_imports.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ impl WildcardImports {
198198
// Allow "...prelude::..::*" imports.
199199
// Many crates have a prelude, and it is imported as a glob by design.
200200
fn is_prelude_import(segments: &[PathSegment<'_>]) -> bool {
201-
segments.iter().filter(|ps| ps.ident.as_str() == "prelude").count() > 0
201+
segments.iter().any(|ps| ps.ident.as_str() == "prelude")
202202
}
203203

204204
// Allow "super::*" imports in tests.

0 commit comments

Comments
 (0)