mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: get rid of lifetime GATs (#5478)
This commit is contained in:
@ -153,7 +153,7 @@ pub fn open_db(path: &Path, log_level: Option<LogLevel>) -> eyre::Result<Databas
|
||||
#[cfg(any(test, feature = "test-utils"))]
|
||||
pub mod test_utils {
|
||||
use super::*;
|
||||
use crate::database::{Database, DatabaseGAT};
|
||||
use crate::database::Database;
|
||||
use std::{path::PathBuf, sync::Arc};
|
||||
|
||||
/// Error during database open
|
||||
@ -193,17 +193,14 @@ pub mod test_utils {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, DB: Database> DatabaseGAT<'a> for TempDatabase<DB> {
|
||||
type TX = <DB as DatabaseGAT<'a>>::TX;
|
||||
type TXMut = <DB as DatabaseGAT<'a>>::TXMut;
|
||||
}
|
||||
|
||||
impl<DB: Database> Database for TempDatabase<DB> {
|
||||
fn tx(&self) -> Result<<Self as DatabaseGAT<'_>>::TX, DatabaseError> {
|
||||
type TX = <DB as Database>::TX;
|
||||
type TXMut = <DB as Database>::TXMut;
|
||||
fn tx(&self) -> Result<Self::TX, DatabaseError> {
|
||||
self.db().tx()
|
||||
}
|
||||
|
||||
fn tx_mut(&self) -> Result<<Self as DatabaseGAT<'_>>::TXMut, DatabaseError> {
|
||||
fn tx_mut(&self) -> Result<Self::TXMut, DatabaseError> {
|
||||
self.db().tx_mut()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user