Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/build_helper/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ pub fn try_run_suppressed(cmd: &mut Command) -> bool {
output.status.success()
}

pub fn gnu_target(target: &str) -> String {
pub fn gnu_target(target: &str) -> &str {
match target {
"i686-pc-windows-msvc" => "i686-pc-win32".to_string(),
"x86_64-pc-windows-msvc" => "x86_64-pc-win32".to_string(),
"i686-pc-windows-gnu" => "i686-w64-mingw32".to_string(),
"x86_64-pc-windows-gnu" => "x86_64-w64-mingw32".to_string(),
s => s.to_string(),
"i686-pc-windows-msvc" => "i686-pc-win32",
"x86_64-pc-windows-msvc" => "x86_64-pc-win32",
"i686-pc-windows-gnu" => "i686-w64-mingw32",
"x86_64-pc-windows-gnu" => "x86_64-w64-mingw32",
s => s,
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/librustc_errors/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ pub enum StringPart {
}

impl StringPart {
pub fn content(&self) -> String {
pub fn content(&self) -> &str {
match self {
&StringPart::Normal(ref s) | & StringPart::Highlighted(ref s) => s.to_owned()
&StringPart::Normal(ref s) | & StringPart::Highlighted(ref s) => s
}
}
}
Expand Down Expand Up @@ -398,7 +398,7 @@ impl Diagnostic {
}

pub fn message(&self) -> String {
self.message.iter().map(|i| i.0.to_owned()).collect::<String>()
self.message.iter().map(|i| i.0.as_str()).collect::<String>()
}

pub fn styled_message(&self) -> &Vec<(String, Style)> {
Expand Down Expand Up @@ -448,7 +448,7 @@ impl Diagnostic {

impl SubDiagnostic {
pub fn message(&self) -> String {
self.message.iter().map(|i| i.0.to_owned()).collect::<String>()
self.message.iter().map(|i| i.0.as_str()).collect::<String>()
}

pub fn styled_message(&self) -> &Vec<(String, Style)> {
Expand Down