fix clippy warnings

Signed-off-by: Alex Chi <iskyzh@gmail.com>
This commit is contained in:
Alex Chi
2024-01-24 14:39:00 +08:00
parent 4d676a451a
commit 0d995dff19
9 changed files with 50 additions and 51 deletions

View File

@@ -71,22 +71,18 @@ impl SstConcatIterator {
}
fn move_until_valid(&mut self) -> Result<()> {
loop {
if let Some(iter) = self.current.as_mut() {
if iter.is_valid() {
break;
}
if self.next_sst_idx >= self.sstables.len() {
self.current = None;
} else {
self.current = Some(SsTableIterator::create_and_seek_to_first(
self.sstables[self.next_sst_idx].clone(),
)?);
self.next_sst_idx += 1;
}
} else {
while let Some(iter) = self.current.as_mut() {
if iter.is_valid() {
break;
}
if self.next_sst_idx >= self.sstables.len() {
self.current = None;
} else {
self.current = Some(SsTableIterator::create_and_seek_to_first(
self.sstables[self.next_sst_idx].clone(),
)?);
self.next_sst_idx += 1;
}
}
Ok(())
}

View File

@@ -22,10 +22,8 @@ impl<A: StorageIterator, B: StorageIterator> TwoMergeIterator<A, B> {
}
fn skip_b(&mut self) -> Result<()> {
if self.a.is_valid() {
if self.b.is_valid() && self.b.key() == self.a.key() {
self.b.next()?;
}
if self.a.is_valid() && self.b.is_valid() && self.b.key() == self.a.key() {
self.b.next()?;
}
Ok(())
}