diff options
| author | bors <bors@rust-lang.org> | 2017-07-12 11:10:37 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-07-12 11:10:37 +0000 |
| commit | b2b19ec92e233b7f91617e4cc2130e70d6e7a5fd (patch) | |
| tree | 0472e7d9331814166b4e260196600884d861f60b /src/libsyntax/parse/parser.rs | |
| parent | 8bba5ad3098e3f20ab3c506e5a421df5da010df9 (diff) | |
| parent | 40f03a1e0d6702add1922f82d716d5b2c23a59f0 (diff) | |
| download | rust-b2b19ec92e233b7f91617e4cc2130e70d6e7a5fd.tar.gz rust-b2b19ec92e233b7f91617e4cc2130e70d6e7a5fd.zip | |
Auto merge of #42897 - Mark-Simulacrum:pretty-print-refactor, r=jseyfried
Refactor pretty printing slightly This doesn't introduce any functional changes (that I'm aware of). The primary intention here is to clean up the code a little. Each commit is intended to stand alone, reviewing commit-by-commit may be easiest.
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 10 |
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), |
