@@ -666,7 +666,7 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
666666 fn print_tt ( & mut self , tt : & TokenTree , convert_dollar_crate : bool ) -> Spacing {
667667 match tt {
668668 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) ;
670670 self . word ( token_str) ;
671671 if let token:: DocComment ( ..) = token. kind {
672672 self . hardbreak ( )
@@ -770,12 +770,12 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
770770 self . bclose ( span, empty) ;
771771 }
772772 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 ) ;
774774 self . word ( token_str) ;
775775 self . ibox ( 0 ) ;
776776 self . print_tts ( tts, convert_dollar_crate) ;
777777 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 ) ;
779779 self . word ( token_str) ;
780780 }
781781 }
@@ -884,12 +884,7 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
884884 self . tts_to_string ( & TokenStream :: from_nonterminal_ast ( nt) )
885885 }
886886
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 (
893888 & self ,
894889 tok : & TokenKind ,
895890 convert_dollar_crate : Option < Span > ,
@@ -959,14 +954,9 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
959954 }
960955 }
961956
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 > {
968958 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)
970960 }
971961
972962 fn ty_to_string ( & self , ty : & ast:: Ty ) -> String {
0 commit comments