Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: removed redundant trait implementations #1486

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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