diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-02-29 02:16:24 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-29 02:16:24 +0100 |
| commit | bbfec7ca41887af04abb4510677c4539a95f03a2 (patch) | |
| tree | beca90f2df096a812f1015ada4f9d9638cd73849 /src/librustc_errors | |
| parent | 1bb6760968b92acee0a1f9f7d84fa10805157b59 (diff) | |
| parent | 85e59b7664734b3fb0122aa8d341ed7e878569c1 (diff) | |
| download | rust-bbfec7ca41887af04abb4510677c4539a95f03a2.tar.gz rust-bbfec7ca41887af04abb4510677c4539a95f03a2.zip | |
Rollup merge of #69567 - matthiaskrgr:useless_fmt, r=nagisa
use .to_string() instead of format!() macro to create strings handles what is left after https://github.com/rust-lang/rust/pull/69541
Diffstat (limited to 'src/librustc_errors')
| -rw-r--r-- | src/librustc_errors/diagnostic.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_errors/diagnostic.rs b/src/librustc_errors/diagnostic.rs index 189b5bd0f9e..1cc5daafed1 100644 --- a/src/librustc_errors/diagnostic.rs +++ b/src/librustc_errors/diagnostic.rs @@ -167,17 +167,17 @@ impl Diagnostic { found: DiagnosticStyledString, ) -> &mut Self { let mut msg: Vec<_> = - vec![(format!("required when trying to coerce from type `"), Style::NoStyle)]; + vec![("required when trying to coerce from type `".to_string(), Style::NoStyle)]; msg.extend(expected.0.iter().map(|x| match *x { StringPart::Normal(ref s) => (s.to_owned(), Style::NoStyle), StringPart::Highlighted(ref s) => (s.to_owned(), Style::Highlight), })); - msg.push((format!("` to type '"), Style::NoStyle)); + msg.push(("` to type '".to_string(), Style::NoStyle)); msg.extend(found.0.iter().map(|x| match *x { StringPart::Normal(ref s) => (s.to_owned(), Style::NoStyle), StringPart::Highlighted(ref s) => (s.to_owned(), Style::Highlight), })); - msg.push((format!("`"), Style::NoStyle)); + msg.push(("`".to_string(), Style::NoStyle)); // For now, just attach these as notes self.highlighted_note(msg); |
