mirror of
https://github.com/taiki-e/install-action.git
synced 2026-04-09 18:11:48 +08:00
Fix clippy::unnecessary_map_or warning
```
error: this `map_or` is redundant
--> tools/codegen/src/main.rs:68:34
|
68 | if r.len() < per_page || version_req.map_or(false, |req| req == "latest") {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_some_and instead: `version_req.is_some_and(|req| req == "latest")`
|
= 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)]`
```
This commit is contained in:
@@ -65,7 +65,7 @@ fn main() -> Result<()> {
|
||||
))?
|
||||
.into_json()?;
|
||||
// If version_req is latest, it is usually sufficient to look at the latest 100 releases.
|
||||
if r.len() < per_page || version_req.map_or(false, |req| req == "latest") {
|
||||
if r.len() < per_page || version_req.is_some_and(|req| req == "latest") {
|
||||
releases.append(&mut r);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user