diff --git a/src/cargo.rs b/src/cargo.rs index da2c6806..8c048a3f 100644 --- a/src/cargo.rs +++ b/src/cargo.rs @@ -83,7 +83,7 @@ impl Workspace { if doctests { need_doctest_in_workspace = cmd!(config.cargo(), "-Z", "help") .read() - .map_or(false, |s| s.contains("doctest-in-workspace")); + .is_ok_and(|s| s.contains("doctest-in-workspace")); } let target_dir = diff --git a/src/context.rs b/src/context.rs index 0efdc6af..f2684ef1 100644 --- a/src/context.rs +++ b/src/context.rs @@ -155,7 +155,7 @@ impl Context { let toolchain = sysroot.file_name().unwrap(); if cmd!("rustup", "toolchain", "list") .read() - .map_or(false, |t| t.contains(toolchain)) + .is_ok_and(|t| t.contains(toolchain)) { // If toolchain is installed from rustup and llvm-tools-preview is not installed, // suggest installing llvm-tools-preview via rustup. diff --git a/src/main.rs b/src/main.rs index 901fa88a..534a6f47 100644 --- a/src/main.rs +++ b/src/main.rs @@ -699,7 +699,7 @@ fn object_files(cx: &Context) -> Result> { let p = e.path(); if p.is_dir() { if p.file_name() - .map_or(false, |f| f == "incremental" || f == ".fingerprint" || f == "out") + .is_some_and(|f| f == "incremental" || f == ".fingerprint" || f == "out") { // Ignore incremental compilation related files and output from build scripts. return false; @@ -1310,7 +1310,7 @@ fn resolve_excluded_paths(cx: &Context) -> Vec { for _ in WalkDir::new(excluded).into_iter().filter_entry(|e| { let p = e.path(); if !p.is_dir() { - if p.extension().map_or(false, |e| e == "rs") { + if p.extension().is_some_and(|e| e == "rs") { let p = p.strip_prefix(&cx.ws.metadata.workspace_root).unwrap_or(p); excluded_path.push(p.to_owned().try_into().unwrap()); }