Address various clippy warnings/errors in zcash_primitives

This commit is contained in:
Jack Grigg
2019-08-02 11:25:00 +01:00
parent d65fe2cda9
commit 3a8efd9e67
18 changed files with 97 additions and 107 deletions

View File

@@ -153,7 +153,7 @@ impl TransactionMetadata {
/// they added (via the first call to [`Builder::add_sapling_spend`]) is the first
/// [`SpendDescription`] in the transaction.
pub fn spend_index(&self, n: usize) -> Option<usize> {
self.spend_indices.get(n).map(|i| *i)
self.spend_indices.get(n).copied()
}
/// Returns the index within the transaction of the [`OutputDescription`] corresponding
@@ -164,7 +164,7 @@ impl TransactionMetadata {
/// they added (via the first call to [`Builder::add_sapling_output`]) is the first
/// [`OutputDescription`] in the transaction.
pub fn output_index(&self, n: usize) -> Option<usize> {
self.output_indices.get(n).map(|i| *i)
self.output_indices.get(n).copied()
}
}
@@ -414,7 +414,7 @@ impl<R: RngCore + CryptoRng> Builder<R> {
self.mtx.shielded_spends.push(SpendDescription {
cv,
anchor: anchor,
anchor,
nullifier,
rk,
zkproof,