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 4364a8c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
56 changes: 28 additions & 28 deletions src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,34 +490,34 @@ 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;
//
// 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
2 changes: 1 addition & 1 deletion src/tree.rs
Original file line number Diff line number Diff line change
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

0 comments on commit 4364a8c

Please sign in to comment.