Refactor zcash_primitives::merkle_tree::CommitmentTreeWitness

- The internal Option wrapper was an unnecessary leftover from when this
  code was directly inside the prover, where Some(x) represents an
  assigned variable.
- CommitmentTreeWitness::from_slice_with_depth is more idiomatic Rust.
This commit is contained in:
Jack Grigg
2020-02-07 00:06:57 +00:00
parent ee32f7facb
commit 2064d1c801
2 changed files with 33 additions and 40 deletions

View File

@@ -117,7 +117,7 @@ impl SaplingProvingContext {
auth_path: witness
.auth_path
.iter()
.map(|n| n.map(|(node, b)| (node.into(), b)))
.map(|(node, b)| Some(((*node).into(), *b)))
.collect(),
anchor: Some(anchor),
};