Skip to content

Commit

Permalink
chore: clippy::unnecessary_map_or
Browse files Browse the repository at this point in the history
warning: this `map_or` can be simplified
   --> src/select.rs:244:9
    |
244 |         self.cur().map_or(true, |c| c == ',' || c == '-')
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_none_or instead: `self.cur().is_none_or(|c| c == ',' || c == '-')`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or
    = note: `#[warn(clippy::unnecessary_map_or)]` on by default

warning: this `map_or` can be simplified
   --> src/select.rs:248:9
    |
248 |         self.cur().map_or(true, |c| c == ',')
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_none_or instead: `self.cur().is_none_or(|c| c == ',')`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or

warning: this `map_or` can be simplified
    --> src/util.rs:1243:9
     |
1243 |         self.cur().map_or(true, |c| c == ',')
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_none_or instead: `self.cur().is_none_or(|c| c == ',')`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or
  • Loading branch information
jqnatividad committed Nov 30, 2024
1 parent 70b5fdd commit b68c9b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,11 @@ impl SelectorParser {
}

fn is_end_of_field(&self) -> bool {
self.cur().map_or(true, |c| c == ',' || c == '-')
self.cur().is_none_or(|c| c == ',' || c == '-')
}

fn is_end_of_selector(&self) -> bool {
self.cur().map_or(true, |c| c == ',')
self.cur().is_none_or(|c| c == ',')
}

fn bump(&mut self) {
Expand Down
2 changes: 1 addition & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ impl ColumnNameParser {
}

fn is_end_of_field(&self) -> bool {
self.cur().map_or(true, |c| c == ',')
self.cur().is_none_or(|c| c == ',')
}

fn parse_quoted_name(&mut self) -> Result<String, String> {
Expand Down

0 comments on commit b68c9b8

Please sign in to comment.