We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ad65fee commit 890e4b6Copy full SHA for 890e4b6
tests/compile-test.rs
@@ -12,19 +12,11 @@ use std::path::{Path, PathBuf};
12
mod cargo;
13
14
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
- }
+ option_env!("HOST_LIBS").map_or(cargo::CARGO_TARGET_DIR.join(env!("PROFILE")), PathBuf::from)
20
}
21
22
fn clippy_driver_path() -> PathBuf {
23
- if let Some(path) = option_env!("CLIPPY_DRIVER_PATH") {
24
25
26
- cargo::TARGET_LIB.join("clippy-driver")
27
+ option_env!("CLIPPY_DRIVER_PATH").map_or(cargo::TARGET_LIB.join("clippy-driver"), PathBuf::from)
28
29
30
// When we'll want to use `extern crate ..` for a dependency that is used
0 commit comments