Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix clippy::unnecessary_map_or warning
``` error: this `map_or` is redundant --> src/cargo.rs:84:41 | 84 | need_doctest_in_workspace = cmd!(config.cargo(), "-Z", "help") | _________________________________________^ 85 | | .read() 86 | | .map_or(false, |s| s.contains("doctest-in-workspace")); | |______________________________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or = note: `-D clippy::unnecessary-map-or` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::unnecessary_map_or)]` help: use is_ok_and instead | 84 ~ need_doctest_in_workspace = cmd!(config.cargo(), "-Z", "help") 85 ~ .read().is_ok_and(|s| s.contains("doctest-in-workspace")); | error: this `map_or` is redundant --> src/context.rs:156:24 | 156 | if cmd!("rustup", "toolchain", "list") | ________________________^ 157 | | .read() 158 | | .map_or(false, |t| t.contains(toolchain)) | |_________________________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or help: use is_ok_and instead | 156 ~ if cmd!("rustup", "toolchain", "list") 157 + .read().is_ok_and(|t| t.contains(toolchain)) | error: this `map_or` is redundant --> src/main.rs:701:24 | 701 | if p.file_name() | ________________________^ 702 | | .map_or(false, |f| f == "incremental" || f == ".fingerprint" || f == "out") | |___________________________________________________________________________________________________^ help: use is_some_and instead: `p.file_name().is_some_and(|f| f == "incremental" || f == ".fingerprint" || f == "out")` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or error: this `map_or` is redundant --> src/main.rs:1313:20 | 1313 | if p.extension().map_or(false, |e| e == "rs") { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_some_and instead: `p.extension().is_some_and(|e| e == "rs")` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or ```
- Loading branch information