From a5cbbf5c777398ec9c0cbbdc84ffc82e526a9db5 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 29 Nov 2024 19:34:09 -0800 Subject: [PATCH] Ignore unnecessary_map_or clippy lint 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 ~ }); | --- src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 5593bf3..269daec 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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;