Skip to content

Commit e24cd52

Browse files
committed
Autofix of clippy::map_unwrap_or
1 parent 4cce676 commit e24cd52

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,11 +479,11 @@ impl QueueFile {
479479
self.cached_offsets.push((i, self.last));
480480
}
481481

482+
#[inline]
482483
fn cached_index_up_to(&self, i: usize) -> Option<usize> {
483484
self.cached_offsets
484485
.binary_search_by(|(idx, _)| idx.cmp(&i))
485-
.map(Some)
486-
.unwrap_or_else(|i| i.checked_sub(1))
486+
.map_or_else(|i| i.checked_sub(1), Some)
487487
}
488488

489489
pub fn add_n(

0 commit comments

Comments
 (0)