Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
antonilol committed Dec 27, 2024
1 parent 278ba33 commit fb78011
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/db/lmdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const CURRENT_FORMAT: u64 = 0;

pub struct RowKeyIter<'a, const N: usize>(RoTxn<'static>, heed::RoPrefix<'a, Bytes, Unit>);

impl<'a, const N: usize> Iterator for RowKeyIter<'a, N> {
impl<const N: usize> Iterator for RowKeyIter<'_, N> {
type Item = [u8; N];

fn next(&mut self) -> Option<Self::Item> {
Expand All @@ -30,7 +30,7 @@ impl<'a, const N: usize> Iterator for RowKeyIter<'a, N> {

pub struct HeaderIter<'a>(RoTxn<'static>, heed::RoIter<'a, Bytes, Unit>);

impl<'a> Iterator for HeaderIter<'a> {
impl Iterator for HeaderIter<'_> {
type Item = SerializedHeaderRow;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
2 changes: 1 addition & 1 deletion src/db/redb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const CURRENT_FORMAT: u64 = 0;

pub struct RowKeyIter<'a, const N: usize>(redb::Range<'a, [u8; N], ()>);

impl<'a, const N: usize> Iterator for RowKeyIter<'a, N> {
impl<const N: usize> Iterator for RowKeyIter<'_, N> {
type Item = [u8; N];

fn next(&mut self) -> Option<Self::Item> {
Expand Down
10 changes: 5 additions & 5 deletions src/db/rocksdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,15 @@ impl DBStore {
cf: &rocksdb::ColumnFamily,
readopts: rocksdb::ReadOptions,
prefix: Option<HashPrefix>,
) -> DBIterator<'a, N> {
) -> DBIterator<'_, N> {
DBIterator::new(self.db.raw_iterator_cf_opt(cf, readopts), prefix)
}

fn iter_prefix_cf<'a>(
&'a self,
fn iter_prefix_cf(
&self,
cf: &rocksdb::ColumnFamily,
prefix: HashPrefix,
) -> DBIterator<'a, HASH_PREFIX_ROW_SIZE> {
) -> DBIterator<'_, HASH_PREFIX_ROW_SIZE> {
let mut opts = rocksdb::ReadOptions::default();
opts.set_prefix_same_as_start(true); // requires .set_prefix_extractor() above.
self.iter_cf(cf, opts, Some(prefix))
Expand Down Expand Up @@ -443,7 +443,7 @@ impl Drop for DBStore {

#[cfg(test)]
mod tests {
use super::{rocksdb, DBStore, WriteBatch, CURRENT_FORMAT};
use super::{rocksdb, DBStore, CURRENT_FORMAT};
use std::ffi::{OsStr, OsString};
use std::path::Path;

Expand Down

0 comments on commit fb78011

Please sign in to comment.