From 53149a18ad73c2e30d1533fe5a17bfb97d463417 Mon Sep 17 00:00:00 2001 From: steviez Date: Fri, 9 Sep 2022 22:27:05 -0500 Subject: [PATCH] Fix partialeq_to_none clippy lint (#27696) --- merkle-tree/src/merkle_tree.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/merkle-tree/src/merkle_tree.rs b/merkle-tree/src/merkle_tree.rs index 70e09c27ec..d08e111d4e 100644 --- a/merkle-tree/src/merkle_tree.rs +++ b/merkle-tree/src/merkle_tree.rs @@ -33,7 +33,7 @@ impl<'a> ProofEntry<'a> { left_sibling: Option<&'a Hash>, right_sibling: Option<&'a Hash>, ) -> Self { - assert!((None == left_sibling) ^ (None == right_sibling)); + assert!(left_sibling.is_none() ^ right_sibling.is_none()); Self(target, left_sibling, right_sibling) } } @@ -154,7 +154,7 @@ impl MerkleTree { let level = &self.nodes[level_start..(level_start + level_len)]; let target = &level[node_index]; - if lsib != None || rsib != None { + if lsib.is_some() || rsib.is_some() { path.push(ProofEntry::new(target, lsib, rsib)); } if node_index % 2 == 0 {