@@ -596,15 +596,15 @@ fn merge_groups_full() {
596
596
597
597
#[ test]
598
598
fn merge_groups_long_full ( ) {
599
- check_crate ( "std::foo::bar::Baz" , r"use std::foo::bar::Qux;" , r"use std::foo::bar::{Qux, Baz };" )
599
+ check_crate ( "std::foo::bar::Baz" , r"use std::foo::bar::Qux;" , r"use std::foo::bar::{Baz, Qux };" )
600
600
}
601
601
602
602
#[ test]
603
603
fn merge_groups_long_last ( ) {
604
604
check_module (
605
605
"std::foo::bar::Baz" ,
606
606
r"use std::foo::bar::Qux;" ,
607
- r"use std::foo::bar::{Qux, Baz };" ,
607
+ r"use std::foo::bar::{Baz, Qux };" ,
608
608
)
609
609
}
610
610
@@ -613,7 +613,7 @@ fn merge_groups_long_full_list() {
613
613
check_crate (
614
614
"std::foo::bar::Baz" ,
615
615
r"use std::foo::bar::{Qux, Quux};" ,
616
- r"use std::foo::bar::{Qux , Quux, Baz };" ,
616
+ r"use std::foo::bar::{Baz , Quux, Qux };" ,
617
617
)
618
618
}
619
619
@@ -622,7 +622,7 @@ fn merge_groups_long_last_list() {
622
622
check_module (
623
623
"std::foo::bar::Baz" ,
624
624
r"use std::foo::bar::{Qux, Quux};" ,
625
- r"use std::foo::bar::{Qux , Quux, Baz };" ,
625
+ r"use std::foo::bar::{Baz , Quux, Qux };" ,
626
626
)
627
627
}
628
628
@@ -631,7 +631,7 @@ fn merge_groups_long_full_nested() {
631
631
check_crate (
632
632
"std::foo::bar::Baz" ,
633
633
r"use std::foo::bar::{Qux, quux::{Fez, Fizz}};" ,
634
- r"use std::foo::bar::{Qux, quux::{Fez, Fizz}, Baz};" ,
634
+ r"use std::foo::bar::{quux::{Fez, Fizz}, Baz, Qux };" ,
635
635
)
636
636
}
637
637
@@ -650,7 +650,7 @@ fn merge_groups_full_nested_deep() {
650
650
check_crate (
651
651
"std::foo::bar::quux::Baz" ,
652
652
r"use std::foo::bar::{Qux, quux::{Fez, Fizz}};" ,
653
- r"use std::foo::bar::{Qux, quux::{Fez, Fizz, Baz }};" ,
653
+ r"use std::foo::bar::{Qux, quux::{Baz, Fez, Fizz }};" ,
654
654
)
655
655
}
656
656
@@ -659,7 +659,7 @@ fn merge_groups_full_nested_long() {
659
659
check_crate (
660
660
"std::foo::bar::Baz" ,
661
661
r"use std::{foo::bar::Qux};" ,
662
- r"use std::{foo::bar::{Qux, Baz }};" ,
662
+ r"use std::{foo::bar::{Baz, Qux }};" ,
663
663
) ;
664
664
}
665
665
@@ -668,7 +668,7 @@ fn merge_groups_last_nested_long() {
668
668
check_crate (
669
669
"std::foo::bar::Baz" ,
670
670
r"use std::{foo::bar::Qux};" ,
671
- r"use std::{foo::bar::{Qux, Baz }};" ,
671
+ r"use std::{foo::bar::{Baz, Qux }};" ,
672
672
) ;
673
673
}
674
674
@@ -733,7 +733,7 @@ fn merge_mod_into_glob() {
733
733
check_with_config (
734
734
"token::TokenKind" ,
735
735
r"use token::TokenKind::*;" ,
736
- r"use token::TokenKind::{*, self };" ,
736
+ r"use token::TokenKind::{self, * };" ,
737
737
& InsertUseConfig {
738
738
granularity : ImportGranularity :: Crate ,
739
739
enforce_granularity : true ,
@@ -742,15 +742,14 @@ fn merge_mod_into_glob() {
742
742
skip_glob_imports : false ,
743
743
} ,
744
744
)
745
- // FIXME: have it emit `use token::TokenKind::{self, *}`?
746
745
}
747
746
748
747
#[ test]
749
748
fn merge_self_glob ( ) {
750
749
check_with_config (
751
750
"self" ,
752
751
r"use self::*;" ,
753
- r"use self::{*, self };" ,
752
+ r"use self::{self, * };" ,
754
753
& InsertUseConfig {
755
754
granularity : ImportGranularity :: Crate ,
756
755
enforce_granularity : true ,
@@ -759,7 +758,6 @@ fn merge_self_glob() {
759
758
skip_glob_imports : false ,
760
759
} ,
761
760
)
762
- // FIXME: have it emit `use {self, *}`?
763
761
}
764
762
765
763
#[ test]
@@ -769,7 +767,7 @@ fn merge_glob() {
769
767
r"
770
768
use syntax::{SyntaxKind::*};" ,
771
769
r"
772
- use syntax::{SyntaxKind::{*, self }};" ,
770
+ use syntax::{SyntaxKind::{self, * }};" ,
773
771
)
774
772
}
775
773
@@ -778,7 +776,7 @@ fn merge_glob_nested() {
778
776
check_crate (
779
777
"foo::bar::quux::Fez" ,
780
778
r"use foo::bar::{Baz, quux::*};" ,
781
- r"use foo::bar::{Baz, quux::{*, Fez }};" ,
779
+ r"use foo::bar::{Baz, quux::{Fez, * }};" ,
782
780
)
783
781
}
784
782
@@ -787,7 +785,7 @@ fn merge_nested_considers_first_segments() {
787
785
check_crate (
788
786
"hir_ty::display::write_bounds_like_dyn_trait" ,
789
787
r"use hir_ty::{autoderef, display::{HirDisplayError, HirFormatter}, method_resolution};" ,
790
- r"use hir_ty::{autoderef, display::{HirDisplayError, HirFormatter, write_bounds_like_dyn_trait }, method_resolution};" ,
788
+ r"use hir_ty::{autoderef, display::{write_bounds_like_dyn_trait, HirDisplayError, HirFormatter }, method_resolution};" ,
791
789
) ;
792
790
}
793
791
0 commit comments