From 58fa0c13286ac120ca841a802c66024d6a00c138 Mon Sep 17 00:00:00 2001 From: ChosunOne Date: Mon, 4 Mar 2019 01:47:41 +0900 Subject: [PATCH] minor style change --- src/merkle_bit.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/merkle_bit.rs b/src/merkle_bit.rs index b4c9234..b1c75f9 100644 --- a/src/merkle_bit.rs +++ b/src/merkle_bit.rs @@ -254,17 +254,16 @@ MerkleBIT { - let key_and_index; - if let Some(_) = n.get_key() { - key_and_index = self.calc_min_split_index(&tree_cell.keys, None, Some(&node))?; + let key_and_index= if n.get_key().is_some() { + self.calc_min_split_index(&tree_cell.keys, None, Some(&node))? } else { let mut hasher = HasherType::new(32); hasher.update(b"b"); hasher.update(n.get_zero()); hasher.update(n.get_one()); let location = hasher.finalize(); - key_and_index = self.calc_min_split_index(&tree_cell.keys, Some(location.as_ref()), None)?; - } + self.calc_min_split_index(&tree_cell.keys, Some(location.as_ref()), None)? + }; let branch_key = key_and_index.0; let min_split_index = key_and_index.1; let descendants = Self::check_descendants(tree_cell.keys, &n, &branch_key, min_split_index);