Use more elegant way to check for prelude string
This commit is contained in:
parent
53508aeb65
commit
e615a26ae4
1 changed files with 1 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue