Skip to content

Commit

Permalink
chore: removed redundant trait implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
Wicpar committed Nov 11, 2023
1 parent 005c023 commit 889df0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 32 deletions.
28 changes: 0 additions & 28 deletions src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,34 +491,6 @@ pub trait Transactional<E = ()> {
}
}

impl<E> Transactional<E> for &Tree {
type View = TransactionalTree;

fn make_overlay(&self) -> Result<TransactionalTrees> {
Ok(TransactionalTrees {
inner: vec![TransactionalTree::from_tree(self)],
})
}

fn view_overlay(overlay: &TransactionalTrees) -> Self::View {
overlay.inner[0].clone()
}
}

impl<E> Transactional<E> for &&Tree {
type View = TransactionalTree;

fn make_overlay(&self) -> Result<TransactionalTrees> {
Ok(TransactionalTrees {
inner: vec![TransactionalTree::from_tree(*self)],
})
}

fn view_overlay(overlay: &TransactionalTrees) -> Self::View {
overlay.inner[0].clone()
}
}

impl<E> Transactional<E> for Tree {
type View = TransactionalTree;

Expand Down
8 changes: 4 additions & 4 deletions src/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
))
}

Expand Down Expand Up @@ -373,7 +373,7 @@ impl Tree {
&transaction::TransactionalTree,
) -> transaction::ConflictableTransactionResult<A, E>,
{
Transactional::transaction(&self, f)
Transactional::transaction(self, f)
}

/// Create a new batched update that can be
Expand Down Expand Up @@ -948,7 +948,7 @@ impl Tree {
} else {
Err(Error::ReportableBug(
"threadpool failed to complete \
action before shutdown"
action before shutdown",
))
}
}
Expand Down Expand Up @@ -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",
));
}

Expand Down

0 comments on commit 889df0e

Please sign in to comment.