Skip to content

Commit

Permalink
replace mem::replace with mem::take
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Laine committed Jul 26, 2024
1 parent 6da63d3 commit baf2898
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions firewood/src/merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -797,13 +797,7 @@ impl<T: NodeWriter> MutableProposal<T> {
} else {
// The branch's only child becomes the root of this subtrie.
let mut child = match child {
Child::Node(ref mut child_node) => std::mem::replace(
child_node,
Node::Leaf(LeafNode {
value: Box::from([]),
partial_path: Path::new(),
}),
),
Child::Node(ref mut child_node) => std::mem::take(child_node),
Child::AddressWithHash(addr, _) => {
let node = self.nodestore.read_node(*addr)?;
self.deleted.push(*addr);
Expand Down

0 comments on commit baf2898

Please sign in to comment.