File tree 2 files changed +12
-5
lines changed
2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -224,16 +224,16 @@ fn emit_reexport(
224
224
ImportKind :: Glob => path_components. push ( name. to_owned ( ) ) ,
225
225
ImportKind :: TypeOnly => path_components. push ( "self" . to_owned ( ) ) ,
226
226
} ;
227
- let key = path_components. join ( "::" ) ;
228
- // prevent duplicate imports
229
- if uses. contains_key ( & key) {
230
- return ;
231
- }
232
227
233
228
let alias = alias. map ( |alias| match alias {
234
229
ImportAlias :: Underscore => "_" . to_owned ( ) ,
235
230
ImportAlias :: Alias ( name) => name. as_str ( ) . to_owned ( ) ,
236
231
} ) ;
232
+ let key = format ! (
233
+ "{} as {}" ,
234
+ path_components. join( "::" ) ,
235
+ alias. as_ref( ) . unwrap_or( & "" . to_owned( ) )
236
+ ) ;
237
237
let rename = alias. map ( |name| {
238
238
let name = Some ( trap. emit ( generated:: Name {
239
239
id : trap:: TrapId :: Star ,
@@ -244,6 +244,10 @@ fn emit_reexport(
244
244
name,
245
245
} )
246
246
} ) ;
247
+ // prevent duplicate imports
248
+ if uses. contains_key ( & key) {
249
+ return ;
250
+ }
247
251
let path = make_qualified_path ( trap, path_components) ;
248
252
let use_tree = trap. emit ( generated:: UseTree {
249
253
id : trap:: TrapId :: Star ,
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ lib.rs:
44
44
#-----| -> use ...::canonicalize
45
45
#-----| -> use ...::copy
46
46
#-----| -> use ...::create_dir
47
+ #-----| -> use ...::create_dir as mkdir
47
48
#-----| -> use ...::create_dir_all
48
49
#-----| -> use ...::exists
49
50
#-----| -> use ...::hard_link
@@ -92,6 +93,8 @@ lib.rs:
92
93
93
94
#-----| use ...::create_dir
94
95
96
+ #-----| use ...::create_dir as mkdir
97
+
95
98
#-----| use ...::create_dir_all
96
99
97
100
#-----| use ...::exists
You can’t perform that action at this time.
0 commit comments