Skip to content

Commit d26c4b7

Browse files
Inline rust_printer
1 parent ff27756 commit d26c4b7

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

src/libsyntax/print/pprust.rs

+9-14
Original file line numberDiff line numberDiff 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-
6856
crate 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
}

0 commit comments

Comments
 (0)