Skip to content

Commit

Permalink
chore: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuhvi committed Dec 29, 2023
1 parent 5ca4df1 commit 8ac68bd
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions mast/src/operations/remove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use super::search::binary_search_path;
use crate::node::{Branch, Node};

/// Removes the target node if it exists, and returns the new root and the removed node.
pub(crate) fn remove<'a>(
pub(crate) fn remove(
nodes_table: &'_ mut Table<&'static [u8], (u64, &'static [u8])>,
root: Option<Node>,
key: &[u8],
Expand Down Expand Up @@ -35,7 +35,7 @@ pub(crate) fn remove<'a>(
root = Some(node);
}

return (root, path.found);
(root, path.found)
}

fn zip(
Expand All @@ -48,14 +48,13 @@ fn zip(
let mut left_subtree = Vec::new();
let mut right_subtree = Vec::new();

target
.left()
.and_then(|h| Node::open(nodes_table, h))
.map(|n| left_subtree.push(n));
target
.right()
.and_then(|h| Node::open(nodes_table, h))
.map(|n| right_subtree.push(n));
if let Some(n) = target.left().and_then(|h| Node::open(nodes_table, h)) {
left_subtree.push(n)
}

if let Some(n) = target.right().and_then(|h| Node::open(nodes_table, h)) {
right_subtree.push(n)
}

while let Some(next) = left_subtree
.last()
Expand Down

0 comments on commit 8ac68bd

Please sign in to comment.