Browse Source

Use Iterator::all() in place of Iterator::fold()

master
Jack Grigg 6 years ago
parent
commit
263bbe1207
No known key found for this signature in database
GPG Key ID: 9E8255172BBF9898
  1. 2
      zcash_primitives/src/merkle_tree.rs

2
zcash_primitives/src/merkle_tree.rs

@ -145,7 +145,7 @@ impl CommitmentTree {
self.left.is_some() self.left.is_some()
&& self.right.is_some() && self.right.is_some()
&& self.parents.len() == depth - 1 && self.parents.len() == depth - 1
&& self.parents.iter().fold(true, |acc, p| acc && p.is_some()) && self.parents.iter().all(|p| p.is_some())
} }
/// Adds a note to the tree. Returns an error if the tree is full. /// Adds a note to the tree. Returns an error if the tree is full.

Loading…
Cancel
Save