Skip to content

Commit

Permalink
chore: bump compiler version and clippy fixes (#105)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Chi Z <[email protected]>
  • Loading branch information
skyzh authored Dec 9, 2024
1 parent f99db4d commit 23802b2
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 9 deletions.
4 changes: 2 additions & 2 deletions mini-lsm-mvcc/src/compact/tiered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ impl TieredCompactionController {
.len()
.min(self.options.max_merge_width.unwrap_or(usize::MAX));
println!("compaction triggered by reducing sorted runs");
return Some(TieredCompactionTask {
Some(TieredCompactionTask {
tiers: snapshot
.levels
.iter()
.take(num_tiers_to_take)
.cloned()
.collect::<Vec<_>>(),
bottom_tier_included: snapshot.levels.len() >= num_tiers_to_take,
});
})
}

pub fn apply_compaction_result(
Expand Down
5 changes: 4 additions & 1 deletion mini-lsm-mvcc/src/lsm_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ impl<I: StorageIterator> FusedIterator<I> {
}

impl<I: StorageIterator> StorageIterator for FusedIterator<I> {
type KeyType<'a> = I::KeyType<'a> where Self: 'a;
type KeyType<'a>
= I::KeyType<'a>
where
Self: 'a;

fn is_valid(&self) -> bool {
!self.has_errored && self.iter.is_valid()
Expand Down
5 changes: 4 additions & 1 deletion mini-lsm-mvcc/src/mvcc/txn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,10 @@ impl TxnIterator {
}

impl StorageIterator for TxnIterator {
type KeyType<'a> = &'a [u8] where Self: 'a;
type KeyType<'a>
= &'a [u8]
where
Self: 'a;

fn value(&self) -> &[u8] {
self.iter.value()
Expand Down
5 changes: 4 additions & 1 deletion mini-lsm-starter/src/lsm_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ impl<I: StorageIterator> FusedIterator<I> {
}

impl<I: StorageIterator> StorageIterator for FusedIterator<I> {
type KeyType<'a> = I::KeyType<'a> where Self: 'a;
type KeyType<'a>
= I::KeyType<'a>
where
Self: 'a;

fn is_valid(&self) -> bool {
unimplemented!()
Expand Down
5 changes: 4 additions & 1 deletion mini-lsm-starter/src/mvcc/txn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ impl TxnIterator {
}

impl StorageIterator for TxnIterator {
type KeyType<'a> = &'a [u8] where Self: 'a;
type KeyType<'a>
= &'a [u8]
where
Self: 'a;

fn value(&self) -> &[u8] {
self.iter.value()
Expand Down
4 changes: 2 additions & 2 deletions mini-lsm/src/compact/tiered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ impl TieredCompactionController {
.len()
.min(self.options.max_merge_width.unwrap_or(usize::MAX));
println!("compaction triggered by reducing sorted runs");
return Some(TieredCompactionTask {
Some(TieredCompactionTask {
tiers: snapshot
.levels
.iter()
.take(num_tiers_to_take)
.cloned()
.collect::<Vec<_>>(),
bottom_tier_included: snapshot.levels.len() >= num_tiers_to_take,
});
})
}

pub fn apply_compaction_result(
Expand Down
5 changes: 4 additions & 1 deletion mini-lsm/src/lsm_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ impl<I: StorageIterator> FusedIterator<I> {
}

impl<I: StorageIterator> StorageIterator for FusedIterator<I> {
type KeyType<'a> = I::KeyType<'a> where Self: 'a;
type KeyType<'a>
= I::KeyType<'a>
where
Self: 'a;

fn is_valid(&self) -> bool {
!self.has_errored && self.iter.is_valid()
Expand Down

0 comments on commit 23802b2

Please sign in to comment.