File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -91,13 +91,13 @@ pub fn try_run_suppressed(cmd: &mut Command) -> bool {
9191 output. status . success ( )
9292}
9393
94- pub fn gnu_target ( target : & str ) -> String {
94+ pub fn gnu_target ( target : & str ) -> & str {
9595 match target {
96- "i686-pc-windows-msvc" => "i686-pc-win32" . to_string ( ) ,
97- "x86_64-pc-windows-msvc" => "x86_64-pc-win32" . to_string ( ) ,
98- "i686-pc-windows-gnu" => "i686-w64-mingw32" . to_string ( ) ,
99- "x86_64-pc-windows-gnu" => "x86_64-w64-mingw32" . to_string ( ) ,
100- s => s. to_string ( ) ,
96+ "i686-pc-windows-msvc" => "i686-pc-win32" ,
97+ "x86_64-pc-windows-msvc" => "x86_64-pc-win32" ,
98+ "i686-pc-windows-gnu" => "i686-w64-mingw32" ,
99+ "x86_64-pc-windows-gnu" => "x86_64-w64-mingw32" ,
100+ s => s,
101101 }
102102}
103103
Original file line number Diff line number Diff line change @@ -76,9 +76,9 @@ pub enum StringPart {
7676}
7777
7878impl StringPart {
79- pub fn content ( & self ) -> String {
79+ pub fn content ( & self ) -> & str {
8080 match self {
81- & StringPart :: Normal ( ref s) | & StringPart :: Highlighted ( ref s) => s. to_owned ( )
81+ & StringPart :: Normal ( ref s) | & StringPart :: Highlighted ( ref s) => s
8282 }
8383 }
8484}
@@ -398,7 +398,7 @@ impl Diagnostic {
398398 }
399399
400400 pub fn message ( & self ) -> String {
401- self . message . iter ( ) . map ( |i| i. 0 . to_owned ( ) ) . collect :: < String > ( )
401+ self . message . iter ( ) . map ( |i| i. 0 . as_str ( ) ) . collect :: < String > ( )
402402 }
403403
404404 pub fn styled_message ( & self ) -> & Vec < ( String , Style ) > {
@@ -448,7 +448,7 @@ impl Diagnostic {
448448
449449impl SubDiagnostic {
450450 pub fn message ( & self ) -> String {
451- self . message . iter ( ) . map ( |i| i. 0 . to_owned ( ) ) . collect :: < String > ( )
451+ self . message . iter ( ) . map ( |i| i. 0 . as_str ( ) ) . collect :: < String > ( )
452452 }
453453
454454 pub fn styled_message ( & self ) -> & Vec < ( String , Style ) > {
You can’t perform that action at this time.
0 commit comments