From c43c5185e0cec9bd8b4738e8e4bff60bd63a0fad Mon Sep 17 00:00:00 2001 From: Piotr Idzik <65706193+vil02@users.noreply.github.com> Date: Fri, 28 Feb 2025 09:32:29 +0100 Subject: [PATCH] style: include `unnecessary_map_or` (#872) --- Cargo.toml | 1 - src/graph/astar.rs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 28c7a5cfa02..852aeed9cf1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -163,7 +163,6 @@ cargo_common_metadata = { level = "allow", priority = 1 } # style-lints: doc_lazy_continuation = { level = "allow", priority = 1 } needless_return = { level = "allow", priority = 1 } -unnecessary_map_or = { level = "allow", priority = 1 } # complexity-lints needless_lifetimes = { level = "allow", priority = 1 } precedence = { level = "allow", priority = 1 } diff --git a/src/graph/astar.rs b/src/graph/astar.rs index e2ae5032da2..a4244c87b8b 100644 --- a/src/graph/astar.rs +++ b/src/graph/astar.rs @@ -62,7 +62,7 @@ pub fn astar + Zero>( let real_weight = real_weight + weight; if weights .get(&next) - .map_or(true, |&weight| real_weight < weight) + .is_none_or(|&weight| real_weight < weight) { // current allows us to reach next with lower weight (or at all) // add next to the front