Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/ds/frequency_buckets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1230,10 +1230,10 @@
let mut prev = None;
let mut next = None;
for &f in self.buckets.keys() {
if f < freq && prev.is_none_or(|p| f > p) {
if f < freq && prev.map_or(true, |p| f > p) {

Check failure on line 1233 in src/ds/frequency_buckets.rs

View workflow job for this annotation

GitHub Actions / Clippy

this `map_or` can be simplified
prev = Some(f);
}
if f > freq && next.is_none_or(|n| f < n) {
if f > freq && next.map_or(true, |n| f < n) {

Check failure on line 1236 in src/ds/frequency_buckets.rs

View workflow job for this annotation

GitHub Actions / Clippy

this `map_or` can be simplified
next = Some(f);
}
}
Expand Down Expand Up @@ -2013,7 +2013,7 @@
let Some(freq) = buckets.min_freq() else {
continue;
};
let is_better = best.is_none_or(|(_, best_freq)| freq < best_freq);
let is_better = best.map_or(true, |(_, best_freq)| freq < best_freq);

Check failure on line 2016 in src/ds/frequency_buckets.rs

View workflow job for this annotation

GitHub Actions / Clippy

this `map_or` can be simplified
if is_better {
best = Some((idx, freq));
}
Expand Down Expand Up @@ -2051,7 +2051,7 @@
let Some(freq) = buckets.min_freq() else {
continue;
};
let is_better = best.is_none_or(|(_, best_freq)| freq < best_freq);
let is_better = best.map_or(true, |(_, best_freq)| freq < best_freq);

Check failure on line 2054 in src/ds/frequency_buckets.rs

View workflow job for this annotation

GitHub Actions / Clippy

this `map_or` can be simplified
if is_better {
best = Some((idx, freq));
}
Expand Down
Loading