From a3f3965c368946944425d59370783b3381a1fb4d Mon Sep 17 00:00:00 2001 From: Michael Rosenberg Date: Fri, 15 Sep 2023 16:29:44 -0400 Subject: [PATCH] Fixed clippy warnings --- src/consistency.rs | 3 +-- src/merkle_tree.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/consistency.rs b/src/consistency.rs index 1d9a8a9..c306a20 100644 --- a/src/consistency.rs +++ b/src/consistency.rs @@ -80,8 +80,7 @@ where // We have a special case when the old tree is a subtree of the current tree. This happens // when the old tree is a complete binary tree OR when the old tree equals this tree (i.e., // nothing changed between the trees). - let oldtree_is_subtree = - slice_size.is_power_of_two() || slice_size == num_tree_leaves as usize; + let oldtree_is_subtree = slice_size.is_power_of_two() || slice_size == num_tree_leaves; // If the old tree is a subtree, then the starting idx for the path is the subtree root let mut path_idx = if oldtree_is_subtree { diff --git a/src/merkle_tree.rs b/src/merkle_tree.rs index e415f84..b82d4d5 100644 --- a/src/merkle_tree.rs +++ b/src/merkle_tree.rs @@ -250,7 +250,7 @@ where /// Tries to get the item at the given index pub fn get(&self, idx: usize) -> Option<&T> { - self.leaves.get(idx as usize) + self.leaves.get(idx) } /// Returns all the items