it's ugly but it works
This commit is contained in:
@ -91,14 +91,10 @@ fn explode(node: &mut Node, depth: usize) -> Option<(u8, u8)> {
|
||||
if let Leaf(_) = node {return None;}
|
||||
|
||||
if depth >= 4 {
|
||||
let (left, right) = node.unwrap_branch();
|
||||
match (left, right) {
|
||||
(Leaf(v1), Leaf(v2)) => {
|
||||
let result = (*v1, *v2);
|
||||
*node = Leaf(0);
|
||||
return Some(result);
|
||||
},
|
||||
_ => (),
|
||||
if let (Leaf(v1), Leaf(v2)) = node.unwrap_branch() {
|
||||
let result = (*v1, *v2);
|
||||
*node = Leaf(0);
|
||||
return Some(result);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user