Skip to content

Commit e615a26

Browse files
committed
Use more elegant way to check for prelude string
1 parent 53508ae commit e615a26

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/wildcard_imports.rs

Lines changed: 1 addition & 1 deletion
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)