File tree 1 file changed +15
-18
lines changed
src/tools/rust-analyzer/crates/hir-def/src
1 file changed +15
-18
lines changed Original file line number Diff line number Diff line change @@ -167,11 +167,7 @@ fn collect_import_map(db: &dyn DefDatabase, krate: CrateId) -> ImportMap {
167
167
168
168
let visible_items = mod_data. scope . entries ( ) . filter_map ( |( name, per_ns) | {
169
169
let per_ns = per_ns. filter_visibility ( |vis| vis == Visibility :: Public ) ;
170
- if per_ns. is_none ( ) {
171
- None
172
- } else {
173
- Some ( ( name, per_ns) )
174
- }
170
+ if per_ns. is_none ( ) { None } else { Some ( ( name, per_ns) ) }
175
171
} ) ;
176
172
177
173
for ( name, per_ns) in visible_items {
@@ -591,6 +587,7 @@ mod tests {
591
587
592
588
Some ( format ! ( "{}:\n {:?}\n " , name, map) )
593
589
} )
590
+ . sorted ( )
594
591
. collect :: < String > ( ) ;
595
592
596
593
expect. assert_eq ( & actual)
@@ -624,15 +621,15 @@ mod tests {
624
621
struct Priv;
625
622
" ,
626
623
expect ! [ [ r#"
624
+ lib:
625
+ - Pub (t)
626
+ - Pub2 (t)
627
+ - Pub2 (v)
627
628
main:
628
629
- publ1 (t)
629
630
- real_pu2 (t)
630
631
- real_pub (t)
631
632
- real_pub::Pub (t)
632
- lib:
633
- - Pub (t)
634
- - Pub2 (t)
635
- - Pub2 (v)
636
633
"# ] ] ,
637
634
) ;
638
635
}
@@ -674,13 +671,13 @@ mod tests {
674
671
pub struct S;
675
672
" ,
676
673
expect ! [ [ r#"
674
+ lib:
675
+ - S (t)
676
+ - S (v)
677
677
main:
678
678
- m (t)
679
679
- m::S (t)
680
680
- m::S (v)
681
- lib:
682
- - S (t)
683
- - S (v)
684
681
"# ] ] ,
685
682
) ;
686
683
}
@@ -700,11 +697,11 @@ mod tests {
700
697
}
701
698
" ,
702
699
expect ! [ [ r#"
700
+ lib:
701
+ - pub_macro (m)
703
702
main:
704
703
- m (t)
705
704
- m::pub_macro (m)
706
- lib:
707
- - pub_macro (m)
708
705
"# ] ] ,
709
706
) ;
710
707
}
@@ -722,14 +719,14 @@ mod tests {
722
719
}
723
720
" ,
724
721
expect ! [ [ r#"
725
- main:
726
- - reexported_module (t)
727
- - reexported_module::S (t)
728
- - reexported_module::S (v)
729
722
lib:
730
723
- module (t)
731
724
- module::S (t)
732
725
- module::S (v)
726
+ main:
727
+ - reexported_module (t)
728
+ - reexported_module::S (t)
729
+ - reexported_module::S (v)
733
730
"# ] ] ,
734
731
) ;
735
732
}
You can’t perform that action at this time.
0 commit comments