Skip to content

Commit

Permalink
Resolve unnecessary_map_or clippy lint
Browse files Browse the repository at this point in the history
    warning: this `map_or` is redundant
      --> src/count.rs:53:13
       |
    53 |         if !bytes.next().map_or(false, is_ascii_hexdigit) {
       |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_some_and instead: `bytes.next().is_some_and(is_ascii_hexdigit)`
       |
       = 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)]`
  • Loading branch information
dtolnay committed Nov 16, 2024
1 parent 88aa0c9 commit 00f2553
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fn parse_function_name(line: &str) -> Option<String> {
fn has_hash(name: &str) -> bool {
let mut bytes = name.bytes().rev();
for _ in 0..16 {
if !bytes.next().map_or(false, is_ascii_hexdigit) {
if !bytes.next().is_some_and(is_ascii_hexdigit) {
return false;
}
}
Expand Down

0 comments on commit 00f2553

Please sign in to comment.