Skip to content

Commit 890e4b6

Browse files
committed
Update compile-test to follow new lint
1 parent ad65fee commit 890e4b6

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

tests/compile-test.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,11 @@ use std::path::{Path, PathBuf};
1212
mod cargo;
1313

1414
fn host_lib() -> PathBuf {
15-
if let Some(path) = option_env!("HOST_LIBS") {
16-
PathBuf::from(path)
17-
} else {
18-
cargo::CARGO_TARGET_DIR.join(env!("PROFILE"))
19-
}
15+
option_env!("HOST_LIBS").map_or(cargo::CARGO_TARGET_DIR.join(env!("PROFILE")), PathBuf::from)
2016
}
2117

2218
fn clippy_driver_path() -> PathBuf {
23-
if let Some(path) = option_env!("CLIPPY_DRIVER_PATH") {
24-
PathBuf::from(path)
25-
} else {
26-
cargo::TARGET_LIB.join("clippy-driver")
27-
}
19+
option_env!("CLIPPY_DRIVER_PATH").map_or(cargo::TARGET_LIB.join("clippy-driver"), PathBuf::from)
2820
}
2921

3022
// When we'll want to use `extern crate ..` for a dependency that is used

0 commit comments

Comments
 (0)