Skip to content

Commit 09566cc

Browse files
Use UnordSet instead of FxHashSet for names_imported_by_glob_use query.
1 parent 0966f59 commit 09566cc

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

clippy_lints/src/wildcard_imports.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,10 @@ impl LateLintPass<'_> for WildcardImports {
155155
)
156156
};
157157

158-
let imports_string = if used_imports.len() == 1 {
159-
used_imports.iter().next().unwrap().to_string()
158+
let mut imports = used_imports.items().map(ToString::to_string).into_sorted_stable_ord(false);
159+
let imports_string = if imports.len() == 1 {
160+
imports.pop().unwrap()
160161
} else {
161-
let mut imports = used_imports
162-
.iter()
163-
.map(ToString::to_string)
164-
.collect::<Vec<_>>();
165-
imports.sort();
166162
if braced_glob {
167163
imports.join(", ")
168164
} else {

0 commit comments

Comments
 (0)