File tree Expand file tree Collapse file tree 1 file changed +9
-14
lines changed Expand file tree Collapse file tree 1 file changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -53,18 +53,6 @@ pub struct State<'a> {
5353 is_expanded : bool
5454}
5555
56- fn rust_printer < ' a > ( writer : & ' a mut String , ann : & ' a dyn PpAnn ) -> State < ' a > {
57- State {
58- s : pp:: mk_printer ( writer) ,
59- cm : None ,
60- comments : None ,
61- cur_cmnt : 0 ,
62- boxes : Vec :: new ( ) ,
63- ann,
64- is_expanded : false
65- }
66- }
67-
6856crate const INDENT_UNIT : usize = 4 ;
6957
7058/// Requires you to pass an input filename and reader so that
@@ -137,8 +125,15 @@ pub fn to_string<F>(f: F) -> String where
137125{
138126 let mut wr = String :: new ( ) ;
139127 {
140- let ann = NoAnn ;
141- let mut printer = rust_printer ( & mut wr, & ann) ;
128+ let mut printer = State {
129+ s : pp:: mk_printer ( & mut wr) ,
130+ cm : None ,
131+ comments : None ,
132+ cur_cmnt : 0 ,
133+ boxes : Vec :: new ( ) ,
134+ ann : & NoAnn ,
135+ is_expanded : false
136+ } ;
142137 f ( & mut printer) ;
143138 printer. s . eof ( ) ;
144139 }
You can’t perform that action at this time.
0 commit comments