feat: get rid of lifetime GATs (#5478)

This commit is contained in:
Matthias Seitz
2023-11-19 16:21:50 +01:00
committed by GitHub
parent 631eb2b624
commit aea11405ad
57 changed files with 297 additions and 398 deletions

View File

@ -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()
}
}