Skip to content

Commit 2131647

Browse files
Fix panicking when target triplets has less than three elements
1 parent accf8fa commit 2131647

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build-common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// so that mapping to rust standard targets happens correctly.
66
fn convert_custom_linux_target(target: String) -> String {
77
let mut parts: Vec<&str> = target.split('-').collect();
8-
let system = parts[2];
9-
if system == "linux" {
8+
let system = parts.get(2);
9+
if system == Some(&"linux") {
1010
parts[1] = "unknown";
1111
};
1212
parts.join("-")

0 commit comments

Comments
 (0)