Skip to content

Commit

Permalink
Merge pull request #69 from qdrant/clippy-rust-1.75
Browse files Browse the repository at this point in the history
Resolve clippy warnings for Rust 1.75
  • Loading branch information
timvisee committed Jan 10, 2024
2 parents fad0e7c + f8b252a commit 03443c3
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 03443c3

Please sign in to comment.