Skip to content

Commit 135ae03

Browse files
authored
chore: add map_unwrap_or warning (#739)
1 parent 53bc506 commit 135ae03

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ big-math = ["dep:num-bigint", "dep:num-traits"]
2222

2323
[lints.clippy]
2424
uninlined_format_args = "warn"
25+
map_unwrap_or = "warn"

src/graph/astar.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ pub fn astar<V: Ord + Copy, E: Ord + Copy + Add<Output = E> + Zero>(
6262
let real_weight = real_weight + weight;
6363
if weights
6464
.get(&next)
65-
.map(|&weight| real_weight < weight)
66-
.unwrap_or(true)
65+
.map_or(true, |&weight| real_weight < weight)
6766
{
6867
// current allows us to reach next with lower weight (or at all)
6968
// add next to the front

0 commit comments

Comments
 (0)