about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorMark Simulacrum <mark.simulacrum@gmail.com>2017-06-24 21:22:42 -0600
committerMark Simulacrum <mark.simulacrum@gmail.com>2017-07-11 12:09:19 -0600
commitbac4bb96137cad937e4986b37d9e4273d1f01dcf (patch)
treecca8214e224cc36925a3684a201a097ba0ebd809 /src/libsyntax/parse/parser.rs
parenta1f180bde3fedc67db04e595a29c9cb4e03f7eaf (diff)
downloadrust-bac4bb96137cad937e4986b37d9e4273d1f01dcf.tar.gz
rust-bac4bb96137cad937e4986b37d9e4273d1f01dcf.zip
Refactor methods onto Printer struct.
No (intentional) changes to behavior. This is intended to avoid the
anti-pattern of having to import individual methods throughout code.
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 093ab0073f0..74b2ea1df32 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -1480,10 +1480,9 @@ impl<'a> Parser<'a> {
         match ty.node {
             TyKind::Rptr(ref lifetime, ref mut_ty) => {
                 let sum_with_parens = pprust::to_string(|s| {
-                    use print::pp::word;
                     use print::pprust::PrintState;
 
-                    word(&mut s.s, "&")?;
+                    s.s.word("&")?;
                     s.print_opt_lifetime(lifetime)?;
                     s.print_mutability(mut_ty.mutbl)?;
                     s.popen()?;
@@ -2542,14 +2541,13 @@ impl<'a> Parser<'a> {
                         };
                         let sugg = pprust::to_string(|s| {
                             use print::pprust::PrintState;
-                            use print::pp::word;
                             s.popen()?;
                             s.print_expr(&e)?;
-                            word(&mut s.s, ".")?;
+                            s.s.word( ".")?;
                             s.print_usize(float.trunc() as usize)?;
                             s.pclose()?;
-                            word(&mut s.s, ".")?;
-                            word(&mut s.s, fstr.splitn(2, ".").last().unwrap())
+                            s.s.word(".")?;
+                            s.s.word(fstr.splitn(2, ".").last().unwrap())
                         });
                         err.span_suggestion(
                             lo.to(self.prev_span),