diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2020-02-29 00:35:24 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2020-02-29 01:32:42 +0100 |
| commit | 85e59b7664734b3fb0122aa8d341ed7e878569c1 (patch) | |
| tree | 95f22975d064d77f59e1460a775675f0cc9866c8 /src/librustc_errors | |
| parent | 0eb878d2aa6e3a1cb315f3f328681b26bb4bffdb (diff) | |
| download | rust-85e59b7664734b3fb0122aa8d341ed7e878569c1.tar.gz rust-85e59b7664734b3fb0122aa8d341ed7e878569c1.zip | |
use .to_string() instead of format!() macro to create strings
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); |
