Skip to content

Commit 221fd61

Browse files
committed
refactor(build): simplify the code obtaining the current triple
1 parent a47877e commit 221fd61

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

build.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ use std::env;
33
include!("src/dist/triple.rs");
44

55
fn from_build() -> Result<PartialTargetTriple, String> {
6-
let triple = if let Ok(triple) = env::var("RUSTUP_OVERRIDE_BUILD_TRIPLE") {
7-
triple
8-
} else {
9-
env::var("TARGET").unwrap()
10-
};
6+
let triple =
7+
env::var("RUSTUP_OVERRIDE_BUILD_TRIPLE").unwrap_or_else(|_| env::var("TARGET").unwrap());
118
PartialTargetTriple::new(&triple).ok_or(triple)
129
}
1310

0 commit comments

Comments
 (0)