From 889df0ed27c24f4a10d65664cadbf7b344404143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Nieto?= Date: Sat, 11 Nov 2023 22:46:48 +0100 Subject: [PATCH] chore: removed redundant trait implementations --- src/transaction.rs | 28 ---------------------------- src/tree.rs | 8 ++++---- 2 files changed, 4 insertions(+), 32 deletions(-) diff --git a/src/transaction.rs b/src/transaction.rs index a2bd6e69f..14845af01 100644 --- a/src/transaction.rs +++ b/src/transaction.rs @@ -491,34 +491,6 @@ pub trait Transactional { } } -impl Transactional for &Tree { - type View = TransactionalTree; - - fn make_overlay(&self) -> Result { - Ok(TransactionalTrees { - inner: vec![TransactionalTree::from_tree(self)], - }) - } - - fn view_overlay(overlay: &TransactionalTrees) -> Self::View { - overlay.inner[0].clone() - } -} - -impl Transactional for &&Tree { - type View = TransactionalTree; - - fn make_overlay(&self) -> Result { - Ok(TransactionalTrees { - inner: vec![TransactionalTree::from_tree(*self)], - }) - } - - fn view_overlay(overlay: &TransactionalTrees) -> Self::View { - overlay.inner[0].clone() - } -} - impl Transactional for Tree { type View = TransactionalTree; diff --git a/src/tree.rs b/src/tree.rs index b1a540afa..0e12b3f36 100644 --- a/src/tree.rs +++ b/src/tree.rs @@ -42,7 +42,7 @@ const fn bounds_error() -> Result<()> { Err(Error::Unsupported( "Keys and values are limited to \ 128gb on 64-bit platforms and - 512mb on 32-bit platforms." + 512mb on 32-bit platforms.", )) } @@ -373,7 +373,7 @@ impl Tree { &transaction::TransactionalTree, ) -> transaction::ConflictableTransactionResult, { - Transactional::transaction(&self, f) + Transactional::transaction(self, f) } /// Create a new batched update that can be @@ -948,7 +948,7 @@ impl Tree { } else { Err(Error::ReportableBug( "threadpool failed to complete \ - action before shutdown" + action before shutdown", )) } } @@ -1163,7 +1163,7 @@ impl Tree { return Err(Error::Unsupported( "must set a merge operator on this Tree \ before calling merge by calling \ - Tree::set_merge_operator" + Tree::set_merge_operator", )); }