Rust 1.89 compiler lint fix (#7644)

Fix lints for Rust 1.89 beta compiler
This commit is contained in:
chonghe
2025-06-25 13:33:17 +08:00
committed by GitHub
parent 56b2d4b525
commit 8e3c5d1524
28 changed files with 86 additions and 70 deletions

View File

@@ -83,7 +83,7 @@ impl Environment {
}
}
pub fn create_databases(&self) -> Result<OpenDatabases, Error> {
pub fn create_databases(&self) -> Result<OpenDatabases<'_>, Error> {
match self {
#[cfg(feature = "mdbx")]
Self::Mdbx(env) => env.create_databases(),
@@ -95,7 +95,7 @@ impl Environment {
}
}
pub fn begin_rw_txn(&self) -> Result<RwTransaction, Error> {
pub fn begin_rw_txn(&self) -> Result<RwTransaction<'_>, Error> {
match self {
#[cfg(feature = "mdbx")]
Self::Mdbx(env) => env.begin_rw_txn().map(RwTransaction::Mdbx),
@@ -194,7 +194,7 @@ impl<'env> RwTransaction<'env> {
impl Cursor<'_> {
/// Return the first key in the current database while advancing the cursor's position.
pub fn first_key(&mut self) -> Result<Option<Key>, Error> {
pub fn first_key(&mut self) -> Result<Option<Key<'_>>, Error> {
match self {
#[cfg(feature = "mdbx")]
Cursor::Mdbx(cursor) => cursor.first_key(),
@@ -207,7 +207,7 @@ impl Cursor<'_> {
}
/// Return the last key in the current database while advancing the cursor's position.
pub fn last_key(&mut self) -> Result<Option<Key>, Error> {
pub fn last_key(&mut self) -> Result<Option<Key<'_>>, Error> {
match self {
#[cfg(feature = "mdbx")]
Cursor::Mdbx(cursor) => cursor.last_key(),
@@ -219,7 +219,7 @@ impl Cursor<'_> {
}
}
pub fn next_key(&mut self) -> Result<Option<Key>, Error> {
pub fn next_key(&mut self) -> Result<Option<Key<'_>>, Error> {
match self {
#[cfg(feature = "mdbx")]
Cursor::Mdbx(cursor) => cursor.next_key(),

View File

@@ -41,7 +41,7 @@ impl Environment {
Ok(Environment { env })
}
pub fn create_databases(&self) -> Result<OpenDatabases, Error> {
pub fn create_databases(&self) -> Result<OpenDatabases<'_>, Error> {
let indexed_attestation_db = self
.env
.create_db(Some(INDEXED_ATTESTATION_DB), Self::db_flags())?;
@@ -80,7 +80,7 @@ impl Environment {
})
}
pub fn begin_rw_txn(&self) -> Result<RwTransaction, Error> {
pub fn begin_rw_txn(&self) -> Result<RwTransaction<'_>, Error> {
let txn = self.env.begin_rw_txn()?;
Ok(RwTransaction { txn })
}
@@ -137,7 +137,7 @@ impl<'env> RwTransaction<'env> {
}
impl<'env> Cursor<'env> {
pub fn first_key(&mut self) -> Result<Option<Key>, Error> {
pub fn first_key(&mut self) -> Result<Option<Key<'_>>, Error> {
let opt_key = self
.cursor
.get(None, None, MDB_FIRST)