@@ -211,7 +211,7 @@ pub fn literal_to_string(lit: token::Lit) -> String {
211211}
212212
213213fn visibility_qualified ( vis : & ast:: Visibility , s : & str ) -> String {
214- format ! ( "{}{}" , State :: new ( ) . to_string( |s| s. print_visibility( vis) ) , s)
214+ format ! ( "{}{}" , State :: to_string( |s| s. print_visibility( vis) ) , s)
215215}
216216
217217impl std:: ops:: Deref for State < ' _ > {
@@ -793,55 +793,55 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
793793 }
794794
795795 fn ty_to_string ( & self , ty : & ast:: Ty ) -> String {
796- self . to_string ( |s| s. print_type ( ty) )
796+ Self :: to_string ( |s| s. print_type ( ty) )
797797 }
798798
799799 fn bounds_to_string ( & self , bounds : & [ ast:: GenericBound ] ) -> String {
800- self . to_string ( |s| s. print_type_bounds ( "" , bounds) )
800+ Self :: to_string ( |s| s. print_type_bounds ( "" , bounds) )
801801 }
802802
803803 fn pat_to_string ( & self , pat : & ast:: Pat ) -> String {
804- self . to_string ( |s| s. print_pat ( pat) )
804+ Self :: to_string ( |s| s. print_pat ( pat) )
805805 }
806806
807807 fn expr_to_string ( & self , e : & ast:: Expr ) -> String {
808- self . to_string ( |s| s. print_expr ( e) )
808+ Self :: to_string ( |s| s. print_expr ( e) )
809809 }
810810
811811 fn tt_to_string ( & self , tt : & TokenTree ) -> String {
812- self . to_string ( |s| s. print_tt ( tt, false ) )
812+ Self :: to_string ( |s| s. print_tt ( tt, false ) )
813813 }
814814
815815 fn tts_to_string ( & self , tokens : & TokenStream ) -> String {
816- self . to_string ( |s| s. print_tts ( tokens, false ) )
816+ Self :: to_string ( |s| s. print_tts ( tokens, false ) )
817817 }
818818
819819 fn stmt_to_string ( & self , stmt : & ast:: Stmt ) -> String {
820- self . to_string ( |s| s. print_stmt ( stmt) )
820+ Self :: to_string ( |s| s. print_stmt ( stmt) )
821821 }
822822
823823 fn item_to_string ( & self , i : & ast:: Item ) -> String {
824- self . to_string ( |s| s. print_item ( i) )
824+ Self :: to_string ( |s| s. print_item ( i) )
825825 }
826826
827827 fn generic_params_to_string ( & self , generic_params : & [ ast:: GenericParam ] ) -> String {
828- self . to_string ( |s| s. print_generic_params ( generic_params) )
828+ Self :: to_string ( |s| s. print_generic_params ( generic_params) )
829829 }
830830
831831 fn path_to_string ( & self , p : & ast:: Path ) -> String {
832- self . to_string ( |s| s. print_path ( p, false , 0 ) )
832+ Self :: to_string ( |s| s. print_path ( p, false , 0 ) )
833833 }
834834
835835 fn path_segment_to_string ( & self , p : & ast:: PathSegment ) -> String {
836- self . to_string ( |s| s. print_path_segment ( p, false ) )
836+ Self :: to_string ( |s| s. print_path_segment ( p, false ) )
837837 }
838838
839839 fn vis_to_string ( & self , v : & ast:: Visibility ) -> String {
840- self . to_string ( |s| s. print_visibility ( v) )
840+ Self :: to_string ( |s| s. print_visibility ( v) )
841841 }
842842
843843 fn block_to_string ( & self , blk : & ast:: Block ) -> String {
844- self . to_string ( |s| {
844+ Self :: to_string ( |s| {
845845 // Containing cbox, will be closed by `print_block` at `}`.
846846 s. cbox ( INDENT_UNIT ) ;
847847 // Head-ibox, will be closed by `print_block` after `{`.
@@ -851,22 +851,22 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
851851 }
852852
853853 fn meta_list_item_to_string ( & self , li : & ast:: NestedMetaItem ) -> String {
854- self . to_string ( |s| s. print_meta_list_item ( li) )
854+ Self :: to_string ( |s| s. print_meta_list_item ( li) )
855855 }
856856
857857 fn attr_item_to_string ( & self , ai : & ast:: AttrItem ) -> String {
858- self . to_string ( |s| s. print_attr_item ( ai, ai. path . span ) )
858+ Self :: to_string ( |s| s. print_attr_item ( ai, ai. path . span ) )
859859 }
860860
861861 fn attribute_to_string ( & self , attr : & ast:: Attribute ) -> String {
862- self . to_string ( |s| s. print_attribute ( attr) )
862+ Self :: to_string ( |s| s. print_attribute ( attr) )
863863 }
864864
865865 fn param_to_string ( & self , arg : & ast:: Param ) -> String {
866- self . to_string ( |s| s. print_param ( arg, false ) )
866+ Self :: to_string ( |s| s. print_param ( arg, false ) )
867867 }
868868
869- fn to_string ( & self , f : impl FnOnce ( & mut State < ' _ > ) ) -> String {
869+ fn to_string ( f : impl FnOnce ( & mut State < ' _ > ) ) -> String {
870870 let mut printer = State :: new ( ) ;
871871 f ( & mut printer) ;
872872 printer. s . eof ( )
@@ -1202,7 +1202,7 @@ impl<'a> State<'a> {
12021202 ) ;
12031203 }
12041204 ast:: ItemKind :: Mod ( unsafety, ref mod_kind) => {
1205- self . head ( self . to_string ( |s| {
1205+ self . head ( Self :: to_string ( |s| {
12061206 s. print_visibility ( & item. vis ) ;
12071207 s. print_unsafety ( unsafety) ;
12081208 s. word ( "mod" ) ;
@@ -1228,7 +1228,7 @@ impl<'a> State<'a> {
12281228 }
12291229 }
12301230 ast:: ItemKind :: ForeignMod ( ref nmod) => {
1231- self . head ( self . to_string ( |s| {
1231+ self . head ( Self :: to_string ( |s| {
12321232 s. print_unsafety ( nmod. unsafety ) ;
12331233 s. word ( "extern" ) ;
12341234 } ) ) ;
@@ -1450,7 +1450,7 @@ impl<'a> State<'a> {
14501450 ast:: CrateSugar :: JustCrate => self . word_nbsp ( "crate" ) ,
14511451 } ,
14521452 ast:: VisibilityKind :: Restricted { ref path, .. } => {
1453- let path = self . to_string ( |s| s. print_path ( path, false , 0 ) ) ;
1453+ let path = Self :: to_string ( |s| s. print_path ( path, false , 0 ) ) ;
14541454 if path == "self" || path == "super" {
14551455 self . word_nbsp ( format ! ( "pub({})" , path) )
14561456 } else {
0 commit comments