mirror of https://github.com/zcash/orchard.git
Fix clippy lints
This commit is contained in:
parent
8f5ac0f36c
commit
6d6832f3f1
|
@ -583,9 +583,7 @@ impl<P: fmt::Debug, V> Bundle<InProgress<P, PartiallyAuthorized>, V> {
|
||||||
self,
|
self,
|
||||||
signatures: &[redpallas::Signature<SpendAuth>],
|
signatures: &[redpallas::Signature<SpendAuth>],
|
||||||
) -> Result<Self, Error> {
|
) -> Result<Self, Error> {
|
||||||
signatures
|
signatures.iter().try_fold(self, Self::append_signature)
|
||||||
.into_iter()
|
|
||||||
.try_fold(self, Self::append_signature)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn append_signature(self, signature: &redpallas::Signature<SpendAuth>) -> Result<Self, Error> {
|
fn append_signature(self, signature: &redpallas::Signature<SpendAuth>) -> Result<Self, Error> {
|
||||||
|
|
|
@ -8,10 +8,10 @@ pub fn gen_const_array<Output: Copy + Default, const LEN: usize>(
|
||||||
|
|
||||||
pub(crate) fn gen_const_array_with_default<Output: Copy, const LEN: usize>(
|
pub(crate) fn gen_const_array_with_default<Output: Copy, const LEN: usize>(
|
||||||
default_value: Output,
|
default_value: Output,
|
||||||
mut closure: impl FnMut(usize) -> Output,
|
closure: impl FnMut(usize) -> Output,
|
||||||
) -> [Output; LEN] {
|
) -> [Output; LEN] {
|
||||||
let mut ret: [Output; LEN] = [default_value; LEN];
|
let mut ret: [Output; LEN] = [default_value; LEN];
|
||||||
for (bit, val) in ret.iter_mut().zip((0..LEN).map(|idx| closure(idx))) {
|
for (bit, val) in ret.iter_mut().zip((0..LEN).map(closure)) {
|
||||||
*bit = val;
|
*bit = val;
|
||||||
}
|
}
|
||||||
ret
|
ret
|
||||||
|
|
|
@ -739,7 +739,7 @@ impl AsRef<[u8; 32]> for OutgoingViewingKey {
|
||||||
/// Defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components][orchardkeycomponents].
|
/// Defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components][orchardkeycomponents].
|
||||||
///
|
///
|
||||||
/// [orchardkeycomponents]: https://zips.z.cash/protocol/nu5.pdf#orchardkeycomponents
|
/// [orchardkeycomponents]: https://zips.z.cash/protocol/nu5.pdf#orchardkeycomponents
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
|
||||||
pub struct DiversifiedTransmissionKey(NonIdentityPallasPoint);
|
pub struct DiversifiedTransmissionKey(NonIdentityPallasPoint);
|
||||||
|
|
||||||
impl DiversifiedTransmissionKey {
|
impl DiversifiedTransmissionKey {
|
||||||
|
@ -772,13 +772,6 @@ impl DiversifiedTransmissionKey {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Required for CtOption operations.
|
|
||||||
impl Default for DiversifiedTransmissionKey {
|
|
||||||
fn default() -> Self {
|
|
||||||
DiversifiedTransmissionKey(NonIdentityPallasPoint::default())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ConditionallySelectable for DiversifiedTransmissionKey {
|
impl ConditionallySelectable for DiversifiedTransmissionKey {
|
||||||
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self {
|
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self {
|
||||||
DiversifiedTransmissionKey(NonIdentityPallasPoint::conditional_select(
|
DiversifiedTransmissionKey(NonIdentityPallasPoint::conditional_select(
|
||||||
|
|
Loading…
Reference in New Issue