diff --git a/src/uucore/build.rs b/src/uucore/build.rs index f3b4df331a7..2aa46d24961 100644 --- a/src/uucore/build.rs +++ b/src/uucore/build.rs @@ -350,9 +350,7 @@ fn embed_locale_file( /// Check if we are cross-compiling for WASI (build.rs runs on the host, /// so `#[cfg(target_os = "wasi")]` does not work here). fn is_wasi_target() -> bool { - env::var("CARGO_CFG_TARGET_OS") - .map(|os| os == "wasi") - .unwrap_or(false) + env::var("CARGO_CFG_TARGET_OS").is_ok_and(|os| os == "wasi") } /// For WASI/WASM builds, embed ALL available .ftl files in a locale diff --git a/src/uucore/src/lib/features/fs.rs b/src/uucore/src/lib/features/fs.rs index 0f2b37dc176..d165b8a9f68 100644 --- a/src/uucore/src/lib/features/fs.rs +++ b/src/uucore/src/lib/features/fs.rs @@ -435,12 +435,11 @@ pub fn canonicalize>( } result.pop(); } - Err(e) => { - if miss_mode == MissingHandling::Existing - || (miss_mode == MissingHandling::Normal && !parts.is_empty()) - { - return Err(e); - } + Err(e) + if (miss_mode == MissingHandling::Existing + || (miss_mode == MissingHandling::Normal && !parts.is_empty())) => + { + return Err(e); } _ => {} }