We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0966f59 commit 09566ccCopy full SHA for 09566cc
clippy_lints/src/wildcard_imports.rs
@@ -155,14 +155,10 @@ impl LateLintPass<'_> for WildcardImports {
155
)
156
};
157
158
- let imports_string = if used_imports.len() == 1 {
159
- used_imports.iter().next().unwrap().to_string()
+ let mut imports = used_imports.items().map(ToString::to_string).into_sorted_stable_ord(false);
+ let imports_string = if imports.len() == 1 {
160
+ imports.pop().unwrap()
161
} else {
- let mut imports = used_imports
162
- .iter()
163
- .map(ToString::to_string)
164
- .collect::<Vec<_>>();
165
- imports.sort();
166
if braced_glob {
167
imports.join(", ")
168
0 commit comments