1
Fork 0

Rollup merge of #92921 - dtolnay:printernew, r=wesleywiser

Rename Printer constructor from mk_printer() to Printer::new()

The original naming is left over from 2011 which was before impl blocks and associated functions existed.

21313d623a/src/comp/pretty/pp.rs
This commit is contained in:
Matthias Krüger 2022-01-17 06:08:16 +01:00 committed by GitHub
commit 216ce7c519
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 27 deletions

View file

@ -170,7 +170,7 @@ impl<'a> State<'a> {
ann: &'a dyn PpAnn,
) -> State<'a> {
State {
s: pp::mk_printer(),
s: pp::Printer::new(),
comments: Some(Comments::new(sm, filename, input)),
attrs,
ann,
@ -186,7 +186,7 @@ pub fn to_string<F>(ann: &dyn PpAnn, f: F) -> String
where
F: FnOnce(&mut State<'_>),
{
let mut printer = State { s: pp::mk_printer(), comments: None, attrs: &|_| &[], ann };
let mut printer = State { s: pp::Printer::new(), comments: None, attrs: &|_| &[], ann };
f(&mut printer);
printer.s.eof()
}