File tree 1 file changed +9
-14
lines changed
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> {
53
53
is_expanded : bool
54
54
}
55
55
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
-
68
56
crate const INDENT_UNIT : usize = 4 ;
69
57
70
58
/// Requires you to pass an input filename and reader so that
@@ -137,8 +125,15 @@ pub fn to_string<F>(f: F) -> String where
137
125
{
138
126
let mut wr = String :: new ( ) ;
139
127
{
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
+ } ;
142
137
f ( & mut printer) ;
143
138
printer. s . eof ( ) ;
144
139
}
You can’t perform that action at this time.
0 commit comments