Skip to content

Commit

Permalink
Ignore unnecessary_map_or clippy lint
Browse files Browse the repository at this point in the history
    warning: this `map_or` can be simplified
       --> src/loc.rs:547:36
        |
    547 |           let serialize_separately = self
        |  ____________________________________^
    548 | |             .spelling_loc
    549 | |             .as_ref()
    550 | |             .zip(self.expansion_loc.as_ref())
    551 | |             .map_or(true, |(spelling_loc, expansion_loc)| {
    552 | |                 !same_bare_source_location(spelling_loc, expansion_loc)
    553 | |             });
        | |______________^
        |
        = 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_none_or instead
        |
    547 ~         let serialize_separately = self
    548 +             .spelling_loc
    549 +             .as_ref()
    550 +             .zip(self.expansion_loc.as_ref()).is_none_or(|(spelling_loc, expansion_loc)| {
    551 +                 !same_bare_source_location(spelling_loc, expansion_loc)
    552 ~             });
        |
  • Loading branch information
dtolnay committed Nov 30, 2024
1 parent d8bbfcc commit a5cbbf5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@
clippy::must_use_candidate,
clippy::needless_lifetimes,
clippy::ptr_arg,
clippy::uninlined_format_args
clippy::uninlined_format_args,
clippy::unnecessary_map_or
)]

mod dedup;
Expand Down

0 comments on commit a5cbbf5

Please sign in to comment.