Skip to content

Commit

Permalink
Use more elegant way to check for prelude string
Browse files Browse the repository at this point in the history
  • Loading branch information
stchris committed Aug 22, 2020
1 parent 53508ae commit e615a26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clippy_lints/src/wildcard_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ impl WildcardImports {
// Allow "...prelude::..::*" imports.
// Many crates have a prelude, and it is imported as a glob by design.
fn is_prelude_import(segments: &[PathSegment<'_>]) -> bool {
segments.iter().filter(|ps| ps.ident.as_str() == "prelude").count() > 0
segments.iter().any(|ps| ps.ident.as_str() == "prelude")
}

// Allow "super::*" imports in tests.
Expand Down

0 comments on commit e615a26

Please sign in to comment.