@@ -666,7 +666,7 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
666
666
fn print_tt ( & mut self , tt : & TokenTree , convert_dollar_crate : bool ) -> Spacing {
667
667
match tt {
668
668
TokenTree :: Token ( token, spacing) => {
669
- let token_str = self . token_to_string_ext ( token, convert_dollar_crate) ;
669
+ let token_str = self . token_to_string ( token, convert_dollar_crate) ;
670
670
self . word ( token_str) ;
671
671
if let token:: DocComment ( ..) = token. kind {
672
672
self . hardbreak ( )
@@ -770,12 +770,12 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
770
770
self . bclose ( span, empty) ;
771
771
}
772
772
delim => {
773
- let token_str = self . token_kind_to_string ( & token:: OpenDelim ( delim) ) ;
773
+ let token_str = self . token_kind_to_string ( & token:: OpenDelim ( delim) , None ) ;
774
774
self . word ( token_str) ;
775
775
self . ibox ( 0 ) ;
776
776
self . print_tts ( tts, convert_dollar_crate) ;
777
777
self . end ( ) ;
778
- let token_str = self . token_kind_to_string ( & token:: CloseDelim ( delim) ) ;
778
+ let token_str = self . token_kind_to_string ( & token:: CloseDelim ( delim) , None ) ;
779
779
self . word ( token_str) ;
780
780
}
781
781
}
@@ -884,12 +884,7 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
884
884
self . tts_to_string ( & TokenStream :: from_nonterminal_ast ( nt) )
885
885
}
886
886
887
- /// Print the token kind precisely, without converting `$crate` into its respective crate name.
888
- fn token_kind_to_string ( & self , tok : & TokenKind ) -> Cow < ' static , str > {
889
- self . token_kind_to_string_ext ( tok, None )
890
- }
891
-
892
- fn token_kind_to_string_ext (
887
+ fn token_kind_to_string (
893
888
& self ,
894
889
tok : & TokenKind ,
895
890
convert_dollar_crate : Option < Span > ,
@@ -959,14 +954,9 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
959
954
}
960
955
}
961
956
962
- /// Print the token precisely, without converting `$crate` into its respective crate name.
963
- fn token_to_string ( & self , token : & Token ) -> Cow < ' static , str > {
964
- self . token_to_string_ext ( token, false )
965
- }
966
-
967
- fn token_to_string_ext ( & self , token : & Token , convert_dollar_crate : bool ) -> Cow < ' static , str > {
957
+ fn token_to_string ( & self , token : & Token , convert_dollar_crate : bool ) -> Cow < ' static , str > {
968
958
let convert_dollar_crate = convert_dollar_crate. then_some ( token. span ) ;
969
- self . token_kind_to_string_ext ( & token. kind , convert_dollar_crate)
959
+ self . token_kind_to_string ( & token. kind , convert_dollar_crate)
970
960
}
971
961
972
962
fn ty_to_string ( & self , ty : & ast:: Ty ) -> String {
0 commit comments