Skip to content

Commit

Permalink
Resolve clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
timvisee committed Jan 10, 2024
1 parent fad0e7c commit f8b252a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl Wal {
// Validate the closed segments. They must be non-overlapping, and contiguous.
closed_segments.sort_by(|a, b| a.start_index.cmp(&b.start_index));
let mut next_start_index = closed_segments
.get(0)
.first()
.map_or(0, |segment| segment.start_index);
for &ClosedSegment {
start_index,
Expand Down Expand Up @@ -393,7 +393,7 @@ impl Wal {
if until
<= self
.closed_segments
.get(0)
.first()
.map_or(0, |segment| segment.start_index)
{
// Do nothing, the first entry is already greater than `until`.
Expand Down Expand Up @@ -449,15 +449,15 @@ impl Wal {
self.open_segment_start_index()
- self
.closed_segments
.get(0)
.first()
.map_or(0, |segment| segment.start_index)
+ self.open_segment.segment.len() as u64
}

/// The index of the first entry.
pub fn first_index(&self) -> u64 {
self.closed_segments
.get(0)
.first()
.map_or(0, |segment| segment.start_index)
}

Expand All @@ -477,7 +477,7 @@ impl fmt::Debug for Wal {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let start_index = self
.closed_segments
.get(0)
.first()
.map_or(0, |segment| segment.start_index);
let end_index = self.open_segment_start_index() + self.open_segment.segment.len() as u64;
write!(
Expand Down

0 comments on commit f8b252a

Please sign in to comment.