mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Use more elegant way to check for prelude string
This commit is contained in:
parent
53508aeb65
commit
e615a26ae4
@ -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…
Reference in New Issue
Block a user