File tree Expand file tree Collapse file tree 1 file changed +12
-18
lines changed Expand file tree Collapse file tree 1 file changed +12
-18
lines changed Original file line number Diff line number Diff line change @@ -679,24 +679,18 @@ impl FromWithTcx<clean::Variant> for Variant {
679
679
impl FromWithTcx < clean:: Import > for Import {
680
680
fn from_tcx ( import : clean:: Import , tcx : TyCtxt < ' _ > ) -> Self {
681
681
use clean:: ImportKind :: * ;
682
- match import. kind {
683
- Simple ( s) => Import {
684
- source : import. source . path . whole_name ( ) ,
685
- name : s. to_string ( ) ,
686
- id : import. source . did . map ( ItemId :: from) . map ( |i| from_item_id ( i, tcx) ) ,
687
- glob : false ,
688
- } ,
689
- Glob => Import {
690
- source : import. source . path . whole_name ( ) ,
691
- name : import
692
- . source
693
- . path
694
- . last_opt ( )
695
- . unwrap_or_else ( || Symbol :: intern ( "*" ) )
696
- . to_string ( ) ,
697
- id : import. source . did . map ( ItemId :: from) . map ( |i| from_item_id ( i, tcx) ) ,
698
- glob : true ,
699
- } ,
682
+ let ( name, glob) = match import. kind {
683
+ Simple ( s) => ( s. to_string ( ) , false ) ,
684
+ Glob => (
685
+ import. source . path . last_opt ( ) . unwrap_or_else ( || Symbol :: intern ( "*" ) ) . to_string ( ) ,
686
+ true ,
687
+ ) ,
688
+ } ;
689
+ Import {
690
+ source : import. source . path . whole_name ( ) ,
691
+ name,
692
+ id : import. source . did . map ( ItemId :: from) . map ( |i| from_item_id ( i, tcx) ) ,
693
+ glob,
700
694
}
701
695
}
702
696
}
You can’t perform that action at this time.
0 commit comments