File tree 2 files changed +10
-10
lines changed
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 {
91
91
output. status . success ( )
92
92
}
93
93
94
- pub fn gnu_target ( target : & str ) -> String {
94
+ pub fn gnu_target ( target : & str ) -> & str {
95
95
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,
101
101
}
102
102
}
103
103
Original file line number Diff line number Diff line change @@ -76,9 +76,9 @@ pub enum StringPart {
76
76
}
77
77
78
78
impl StringPart {
79
- pub fn content ( & self ) -> String {
79
+ pub fn content ( & self ) -> & str {
80
80
match self {
81
- & StringPart :: Normal ( ref s) | & StringPart :: Highlighted ( ref s) => s. to_owned ( )
81
+ & StringPart :: Normal ( ref s) | & StringPart :: Highlighted ( ref s) => s
82
82
}
83
83
}
84
84
}
@@ -398,7 +398,7 @@ impl Diagnostic {
398
398
}
399
399
400
400
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 > ( )
402
402
}
403
403
404
404
pub fn styled_message ( & self ) -> & Vec < ( String , Style ) > {
@@ -448,7 +448,7 @@ impl Diagnostic {
448
448
449
449
impl SubDiagnostic {
450
450
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 > ( )
452
452
}
453
453
454
454
pub fn styled_message ( & self ) -> & Vec < ( String , Style ) > {
You can’t perform that action at this time.
0 commit comments