diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-10-22 08:31:37 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-11-02 09:01:00 +1100 |
| commit | 5bc7084f7e1be9da93bb014e05f19a80ff6fa188 (patch) | |
| tree | 791694964a4af2e1c0f109fb2c423f2e6f9893c5 /src/libsyntax/print | |
| parent | 9cf59b517867562ebf7413ca2cda762c6b7d6fc0 (diff) | |
| download | rust-5bc7084f7e1be9da93bb014e05f19a80ff6fa188.tar.gz rust-5bc7084f7e1be9da93bb014e05f19a80ff6fa188.zip | |
Convert `x.as_str().to_string()` to `x.to_string()` where possible.
Diffstat (limited to 'src/libsyntax/print')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 136fc355f89..74ab5c79019 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -623,7 +623,7 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere } self.maybe_print_comment(attr.span.lo()); if attr.is_sugared_doc { - self.word(attr.value_str().unwrap().as_str().to_string()); + self.word(attr.value_str().unwrap().to_string()); self.hardbreak() } else { match attr.style { @@ -1234,7 +1234,7 @@ impl<'a> State<'a> { } ast::ItemKind::GlobalAsm(ref ga) => { self.head(visibility_qualified(&item.vis, "global_asm!")); - self.s.word(ga.asm.as_str().to_string()); + self.s.word(ga.asm.to_string()); self.end(); } ast::ItemKind::TyAlias(ref ty, ref generics) => { @@ -2335,7 +2335,7 @@ impl<'a> State<'a> { } crate fn print_name(&mut self, name: ast::Name) { - self.s.word(name.as_str().to_string()); + self.s.word(name.to_string()); self.ann.post(self, AnnNode::Name(&name)) } |
