Skip to content

Commit

Permalink
Run cargo dev fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAwesome committed May 9, 2020
1 parent 0c14ea8 commit bdc75db
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions clippy_lints/src/wildcard_imports.rs
Expand Up @@ -158,12 +158,14 @@ impl LateLintPass<'_, '_> for 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().last().map_or(false, |ps| ps.ident.as_str() == "prelude")
segments
.iter()
.last()
.map_or(false, |ps| ps.ident.as_str() == "prelude")
}

// Allow "super::*" imports.
// This is intended primarily to ease the process of writing unit tests.
fn is_super_only_import_in_test(segments: &[PathSegment<'_>]) -> bool {
segments.iter().len() == 1 &&
segments.first().map_or(false, |ps| ps.ident.as_str() == "super")
segments.iter().len() == 1 && segments.first().map_or(false, |ps| ps.ident.as_str() == "super")
}

0 comments on commit bdc75db

Please sign in to comment.