chore: bump compiler version and clippy fixes (#105)

Signed-off-by: Alex Chi Z <iskyzh@gmail.com>
This commit is contained in:
Alex Chi Z.
2024-12-09 00:23:03 -05:00
committed by GitHub
parent f99db4dd61
commit 23802b23dd
7 changed files with 24 additions and 9 deletions

View File

@@ -86,7 +86,7 @@ impl TieredCompactionController {
.len() .len()
.min(self.options.max_merge_width.unwrap_or(usize::MAX)); .min(self.options.max_merge_width.unwrap_or(usize::MAX));
println!("compaction triggered by reducing sorted runs"); println!("compaction triggered by reducing sorted runs");
return Some(TieredCompactionTask { Some(TieredCompactionTask {
tiers: snapshot tiers: snapshot
.levels .levels
.iter() .iter()
@@ -94,7 +94,7 @@ impl TieredCompactionController {
.cloned() .cloned()
.collect::<Vec<_>>(), .collect::<Vec<_>>(),
bottom_tier_included: snapshot.levels.len() >= num_tiers_to_take, bottom_tier_included: snapshot.levels.len() >= num_tiers_to_take,
}); })
} }
pub fn apply_compaction_result( pub fn apply_compaction_result(

View File

@@ -129,7 +129,10 @@ impl<I: StorageIterator> FusedIterator<I> {
} }
impl<I: StorageIterator> StorageIterator for 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 { fn is_valid(&self) -> bool {
!self.has_errored && self.iter.is_valid() !self.has_errored && self.iter.is_valid()

View File

@@ -252,7 +252,10 @@ impl TxnIterator {
} }
impl StorageIterator for 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] { fn value(&self) -> &[u8] {
self.iter.value() self.iter.value()

View File

@@ -59,7 +59,10 @@ impl<I: StorageIterator> FusedIterator<I> {
} }
impl<I: StorageIterator> StorageIterator for 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 { fn is_valid(&self) -> bool {
unimplemented!() unimplemented!()

View File

@@ -104,7 +104,10 @@ impl TxnIterator {
} }
impl StorageIterator for 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] { fn value(&self) -> &[u8] {
self.iter.value() self.iter.value()

View File

@@ -86,7 +86,7 @@ impl TieredCompactionController {
.len() .len()
.min(self.options.max_merge_width.unwrap_or(usize::MAX)); .min(self.options.max_merge_width.unwrap_or(usize::MAX));
println!("compaction triggered by reducing sorted runs"); println!("compaction triggered by reducing sorted runs");
return Some(TieredCompactionTask { Some(TieredCompactionTask {
tiers: snapshot tiers: snapshot
.levels .levels
.iter() .iter()
@@ -94,7 +94,7 @@ impl TieredCompactionController {
.cloned() .cloned()
.collect::<Vec<_>>(), .collect::<Vec<_>>(),
bottom_tier_included: snapshot.levels.len() >= num_tiers_to_take, bottom_tier_included: snapshot.levels.len() >= num_tiers_to_take,
}); })
} }
pub fn apply_compaction_result( pub fn apply_compaction_result(

View File

@@ -99,7 +99,10 @@ impl<I: StorageIterator> FusedIterator<I> {
} }
impl<I: StorageIterator> StorageIterator for 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 { fn is_valid(&self) -> bool {
!self.has_errored && self.iter.is_valid() !self.has_errored && self.iter.is_valid()