Commit afceb72
committed
Fix clippy::unnecessary_map_or warning
```
warning: this `map_or` can be simplified
--> tests/no-core/build.rs:15:5
|
15 | / env::var_os("RUSTC")
16 | | .and_then(|rustc| Command::new(rustc).arg("--version").output().ok())
17 | | .and_then(|output| String::from_utf8(output.stdout).ok())
18 | | .map_or(false, |version| version.contains("nightly") || version.contains("dev"))
| |________________________________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or
= note: `-W clippy::unnecessary-map-or` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::unnecessary_map_or)]`
help: use `is_some_and` instead
|
18 - .map_or(false, |version| version.contains("nightly") || version.contains("dev"))
18 + .is_some_and(|version| version.contains("nightly") || version.contains("dev"))
|
warning: this `map_or` can be simplified
--> pin-project-internal/src/pinned_drop.rs:143:28
|
143 | && get_ty_path(elem).map_or(false, |path| path.is_ident("Self"))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or
= note: `-W clippy::unnecessary-map-or` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::unnecessary_map_or)]`
help: use `is_some_and` instead
|
143 - && get_ty_path(elem).map_or(false, |path| path.is_ident("Self"))
143 + && get_ty_path(elem).is_some_and(|path| path.is_ident("Self"))
|
```1 parent e985eee commit afceb72
File tree
2 files changed
+2
-2
lines changed- pin-project-internal/src
- tests/no-core
2 files changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
0 commit comments