From b42cbe52d058f88f09c551eaf8d05050ccafd8be Mon Sep 17 00:00:00 2001 From: Tommi Pisto Date: Sat, 8 Jul 2023 12:28:27 +0300 Subject: [PATCH] Added 'static bounds to T --- core/mvcc/mvcc-rs/src/cursor.rs | 2 +- core/mvcc/mvcc-rs/src/database/mod.rs | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/core/mvcc/mvcc-rs/src/cursor.rs b/core/mvcc/mvcc-rs/src/cursor.rs index d02e49541..93ec3e2bd 100644 --- a/core/mvcc/mvcc-rs/src/cursor.rs +++ b/core/mvcc/mvcc-rs/src/cursor.rs @@ -13,7 +13,7 @@ pub struct ScanCursor<'a, Clock: LogicalClock, T: Sync + Send + Clone + Serializ tx_id: u64, } -impl<'a, Clock: LogicalClock, T: Sync + Send + Clone + Serialize + DeserializeOwned + Debug> ScanCursor<'a, Clock, T> { +impl<'a, Clock: LogicalClock, T: Sync + Send + Clone + Serialize + DeserializeOwned + Debug + 'static> ScanCursor<'a, Clock, T> { pub fn new( db: &'a Database, tx_id: u64, diff --git a/core/mvcc/mvcc-rs/src/database/mod.rs b/core/mvcc/mvcc-rs/src/database/mod.rs index 9bdade7fd..7f039110b 100644 --- a/core/mvcc/mvcc-rs/src/database/mod.rs +++ b/core/mvcc/mvcc-rs/src/database/mod.rs @@ -267,10 +267,8 @@ pub struct Database< storage: Storage, } -impl< - Clock: LogicalClock, - T: Sync + Send + Clone + Serialize + Debug + DeserializeOwned, - > Database +impl + Database { /// Creates a new database. pub fn new(clock: Clock, storage: Storage) -> Self { @@ -680,8 +678,7 @@ impl< let mut row_versions = row_versions.value().write().unwrap(); row_versions.retain(|rv| rv.begin != TxTimestampOrID::TxID(tx_id)); if row_versions.is_empty() { - // !TODO! FIXME! This is a bug, because we can't remove the row here! - // self.rows.remove(id); + self.rows.remove(id); } } } @@ -757,8 +754,7 @@ impl< } } for id in to_remove { - // !TODO! FIXME! This is a bug, because we can't remove the row here! - // self.rows.remove(&id); + self.rows.remove(&id); } dropped }