Skip to content

Commit

Permalink
remove trailing slashes in toolchain name
Browse files Browse the repository at this point in the history
  • Loading branch information
sathwikmatsa committed Nov 10, 2021
1 parent dda6e5a commit ab12565
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1003,11 +1003,13 @@ impl Cfg {
}

pub(crate) fn resolve_toolchain(&self, name: &str) -> Result<String> {
if let Ok(desc) = dist::PartialToolchainDesc::from_str(name) {
// remove trailing slashes in toolchain name
let normalized_name = name.trim_end_matches('/');
if let Ok(desc) = dist::PartialToolchainDesc::from_str(normalized_name) {
let host = self.get_default_host_triple()?;
Ok(desc.resolve(&host)?.to_string())
} else {
Ok(name.to_owned())
Ok(normalized_name.to_owned())
}
}
}
Expand Down

0 comments on commit ab12565

Please sign in to comment.