Skip to content

Commit

Permalink
Fix panicking when target triplets has less than three elements
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryptex-github committed Nov 22, 2022
1 parent accf8fa commit 2131647
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build-common.rs
Expand Up @@ -5,8 +5,8 @@
// so that mapping to rust standard targets happens correctly.
fn convert_custom_linux_target(target: String) -> String {
let mut parts: Vec<&str> = target.split('-').collect();
let system = parts[2];
if system == "linux" {
let system = parts.get(2);
if system == Some(&"linux") {
parts[1] = "unknown";
};
parts.join("-")
Expand Down

0 comments on commit 2131647

Please sign in to comment.