Commit f70920a
committed
Resolve unnecessary_map_or clippy lint
warning: this `map_or` can be simplified
--> build.rs:76:38
|
76 | if cfg!(not(feature = "std")) && rustc.map_or(false, |rustc| rustc < 81) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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
|
76 - if cfg!(not(feature = "std")) && rustc.map_or(false, |rustc| rustc < 81) {
76 + if cfg!(not(feature = "std")) && rustc.is_some_and(|rustc| rustc < 81) {
|
warning: this `map_or` can be simplified
--> impl/src/expand.rs:385:13
|
385 | / v.attrs
386 | | .display
387 | | .as_ref()
388 | | .map_or(false, |display| display.has_bonus_display)
| |___________________________________________________________________^
|
= 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
|
388 - .map_or(false, |display| display.has_bonus_display)
388 + .is_some_and(|display| display.has_bonus_display)
|
warning: this `map_or` can be simplified
--> impl/src/prop.rs:131:8
|
131 | if from_field.map_or(false, |from_field| {
| ________^
132 | | from_field.member == backtrace_field.member
133 | | }) {
| |______^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or
help: use `is_some_and` instead
|
131 - if from_field.map_or(false, |from_field| {
131 + if from_field.is_some_and(|from_field| {
|
warning: this `map_or` can be simplified
--> impl/src/valid.rs:242:32
|
242 | Type::Reference(ty) => ty
| ________________________________^
243 | | .lifetime
244 | | .as_ref()
245 | | .map_or(false, |lifetime| lifetime.ident != "static"),
| |_________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or
help: use `is_some_and` instead
|
245 - .map_or(false, |lifetime| lifetime.ident != "static"),
245 + .is_some_and(|lifetime| lifetime.ident != "static"),
|1 parent 910be13 commit f70920a
4 files changed
Lines changed: 4 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
388 | | - | |
| 388 | + | |
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
133 | | - | |
| 131 | + | |
134 | 132 | | |
135 | 133 | | |
136 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
0 commit comments