Skip to content

Commit eebae67

Browse files
author
Jon Gjengset
committed
Fix clippy error
1 parent 6c31e5b commit eebae67

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

‎build.rs‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,15 @@ fn compile_probe() -> Option<ExitStatus> {
6969
fs::write(&probefile, PROBE).ok()?;
7070

7171
// Make sure to pick up Cargo rustc configuration.
72-
let mut cmd = if let Some(wrapper) = env::var_os("CARGO_RUSTC_WRAPPER") {
73-
let mut cmd = Command::new(wrapper);
74-
// The wrapper's first argument should always be the path to rustc.
75-
cmd.arg(rustc);
76-
cmd
77-
} else {
78-
Command::new(rustc)
79-
};
72+
let mut cmd = env::var_os("CARGO_RUSTC_WRAPPER").map_or_else(
73+
|| Command::new(&rustc),
74+
|wrapper| {
75+
let mut cmd = Command::new(wrapper);
76+
// The wrapper's first argument should always be the path to rustc.
77+
cmd.arg(&rustc);
78+
cmd
79+
},
80+
);
8081

8182
cmd.stderr(Stdio::null())
8283
.arg("--edition=2018")

0 commit comments

Comments
 (0)