Implement matches! macro (#1777)

Fix #1775
This commit is contained in:
Herman Junge
2020-10-15 21:42:43 +00:00
parent 97be2ca295
commit d7b9d0dd9f
8 changed files with 19 additions and 62 deletions

View File

@@ -156,10 +156,7 @@ impl MerkleTree {
/// Is this Merkle tree a leaf?
pub fn is_leaf(&self) -> bool {
match self {
MerkleTree::Leaf(_) => true,
_ => false,
}
matches!(self, MerkleTree::Leaf(_))
}
/// Return the leaf at `index` and a Merkle proof of its inclusion.