Skip to content

Commit

Permalink
util: remove panics from matches_os and get_arch.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Nov 3, 2021
1 parent 51df6a7 commit 69cacd0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ pub fn matches_os(triple: &str, name: &str) -> bool {
return os == name;
}
}
panic!("Cannot determine OS from triple");
false
}
pub fn get_arch(triple: &str) -> &'static str {
pub fn get_arch(triple: &str) -> &str {
for &(triple_arch, arch) in ARCH_TABLE {
if triple.contains(triple_arch) {
return arch;
}
}
panic!("Cannot determine Architecture from triple");
triple.split('-').nth(0).unwrap()
}

pub fn get_env(triple: &str) -> Option<&str> {
Expand Down

0 comments on commit 69cacd0

Please sign in to comment.