Skip to content

Commit 9b56854

Browse files
Merge #932
932: Fix panicking when target triplets has less than three elements r=taiki-e a=Cryptex-github Currently the build script panic when the target triplets have less than three elements, for example `wasm32-wasi`, this PR fixes that issue. Fixes #931 Co-authored-by: Cryptex <[email protected]>
2 parents accf8fa + 2131647 commit 9b56854

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build-common.rs

+2-2
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)