Skip to content

Implement Base64 encoding for ZIP 304 signatures #389

Implement Base64 encoding for ZIP 304 signatures

Implement Base64 encoding for ZIP 304 signatures #389

This check has been archived and is scheduled for deletion. Learn more about checks retention
GitHub Actions / Clippy (beta) succeeded Nov 13, 2023 in 2s

Clippy (beta)

101 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 101
Note 0
Help 0

Versions

  • rustc 1.75.0-beta.1 (782883f60 2023-11-12)
  • cargo 1.75.0-beta.1 (6790a5127 2023-11-10)
  • clippy 0.1.75 (782883f6 2023-11-12)

Annotations

Check warning on line 177 in zcash_primitives/src/zip32.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

redundant pattern matching, consider using `is_err()`

warning: redundant pattern matching, consider using `is_err()`
   --> zcash_primitives/src/zip32.rs:177:17
    |
177 |         assert!(matches!(u32::try_from(too_big), Err(_)));
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `u32::try_from(too_big).is_err()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
    = note: `-W clippy::redundant-pattern-matching` implied by `-W clippy::all`
    = help: to override `-W clippy::all` add `#[allow(clippy::redundant_pattern_matching)]`

Check warning on line 778 in zcash_primitives/src/transaction/mod.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
   --> zcash_primitives/src/transaction/mod.rs:778:18
    |
778 |             .zip(v_output_proofs.into_iter())
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `v_output_proofs`
    |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
   --> /rustc/782883f609713fe9617ba64d90086742ec62d374/library/core/src/iter/traits/iterator.rs:643:12
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 768 in zcash_primitives/src/transaction/mod.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
   --> zcash_primitives/src/transaction/mod.rs:768:26
    |
768 |                     .zip(v_spend_auth_sigs.into_iter()),
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `v_spend_auth_sigs`
    |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
   --> /rustc/782883f609713fe9617ba64d90086742ec62d374/library/core/src/iter/traits/iterator.rs:643:12
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 79 in zcash_primitives/src/transaction/sighash.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
  --> zcash_primitives/src/transaction/sighash.rs:79:5
   |
79 |     'a,
   |     ^^
...
85 |     signable_input: &SignableInput<'a>,
   |                                    ^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
   |
79 ~     TA: TransparentAuthorizingContext,
80 |     SA: sapling::Authorization<Proof = GrothProofBytes>,
 ...
83 |     tx: &TransactionData<A>,
84 ~     signable_input: &SignableInput<'_>,
   |

Check warning on line 181 in zcash_primitives/src/transaction/components/tze/builder.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
   --> zcash_primitives/src/transaction/components/tze/builder.rs:181:22
    |
181 |                 .zip(payloads.into_iter())
    |                      ^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `payloads`
    |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
   --> /rustc/782883f609713fe9617ba64d90086742ec62d374/library/core/src/iter/traits/iterator.rs:643:12
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 196 in zcash_primitives/src/transaction/components/amount.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

usage of `Iterator::fold` on a type that implements `Try`

warning: usage of `Iterator::fold` on a type that implements `Try`
   --> zcash_primitives/src/transaction/components/amount.rs:196:14
    |
196 |         iter.fold(Some(Amount::zero()), |acc, a| acc? + *a)
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `try_fold` instead: `try_fold(Amount::zero(), |acc, a| ...)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_try_fold

Check warning on line 190 in zcash_primitives/src/transaction/components/amount.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

usage of `Iterator::fold` on a type that implements `Try`

warning: usage of `Iterator::fold` on a type that implements `Try`
   --> zcash_primitives/src/transaction/components/amount.rs:190:14
    |
190 |         iter.fold(Some(Amount::zero()), |acc, a| acc? + a)
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `try_fold` instead: `try_fold(Amount::zero(), |acc, a| ...)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_try_fold
    = note: `-W clippy::manual-try-fold` implied by `-W clippy::all`
    = help: to override `-W clippy::all` add `#[allow(clippy::manual_try_fold)]`

Check warning on line 176 in zcash_primitives/src/sapling/redjubjub.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
   --> zcash_primitives/src/sapling/redjubjub.rs:176:21
    |
176 | pub fn batch_verify<'a, R: RngCore>(
    |                     ^^
177 |     mut rng: &mut R,
178 |     batch: &[BatchEntry<'a>],
    |                         ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    = note: `-W clippy::needless-lifetimes` implied by `-W clippy::all`
    = help: to override `-W clippy::all` add `#[allow(clippy::needless_lifetimes)]`
help: elide the lifetimes
    |
176 ~ pub fn batch_verify<R: RngCore>(
177 |     mut rng: &mut R,
178 ~     batch: &[BatchEntry<'_>],
    |

Check warning on line 41 in zcash_primitives/src/sapling/pedersen_hash.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
  --> zcash_primitives/src/sapling/pedersen_hash.rs:41:16
   |
41 |         .chain(bits.into_iter());
   |                ^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `bits`
   |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
  --> /rustc/782883f609713fe9617ba64d90086742ec62d374/library/core/src/iter/traits/iterator.rs:524:12
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 395 in zcash_primitives/src/sapling/note_encryption.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
   --> zcash_primitives/src/sapling/note_encryption.rs:395:18
    |
395 |             .zip(ephemeral_keys.into_iter())
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `ephemeral_keys`
    |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
   --> /rustc/782883f609713fe9617ba64d90086742ec62d374/library/core/src/iter/traits/iterator.rs:643:12
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 374 in zcash_primitives/src/sapling/note_encryption.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
   --> zcash_primitives/src/sapling/note_encryption.rs:374:18
    |
374 |             .zip(ephemeral_keys.into_iter())
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `ephemeral_keys`
    |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
   --> /rustc/782883f609713fe9617ba64d90086742ec62d374/library/core/src/iter/traits/iterator.rs:643:12
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 139 in zcash_primitives/src/merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

useless conversion to the same type: `std::ops::Range<u8>`

warning: useless conversion to the same type: `std::ops::Range<u8>`
   --> zcash_primitives/src/merkle_tree.rs:138:26
    |
138 |                   parents: (1..DEPTH)
    |  __________________________^
139 | |                     .into_iter()
    | |________________________________^ help: consider removing `.into_iter()`: `(1..DEPTH)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
    = note: `-W clippy::useless-conversion` implied by `-W clippy::all`
    = help: to override `-W clippy::all` add `#[allow(clippy::useless_conversion)]`

Check warning on line 158 in zcash_primitives/src/legacy.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

useless use of `vec!`

warning: useless use of `vec!`
   --> zcash_primitives/src/legacy.rs:158:30
    |
158 |             let short_data = vec![2; 100];
    |                              ^^^^^^^^^^^^ help: you can use an array directly: `[2; 100]`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
    = note: `-W clippy::useless-vec` implied by `-W clippy::all`
    = help: to override `-W clippy::all` add `#[allow(clippy::useless_vec)]`

Check warning on line 104 in zcash_extensions/src/transparent/demo.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
   --> zcash_extensions/src/transparent/demo.rs:104:12
    |
104 |     fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> fmt::Result {
    |            ^^                                ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
104 -     fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> fmt::Result {
104 +     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    |

Check warning on line 103 in zcash_extensions/src/consensus/transparent.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
   --> zcash_extensions/src/consensus/transparent.rs:103:15
    |
103 |     fn verify<'a>(
    |               ^^
...
107 |         ctx: &Context<'a>,
    |                       ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
103 ~     fn verify(
104 |         &self,
105 |         precondition: &Precondition,
106 |         witness: &Witness<AuthData>,
107 ~         ctx: &Context<'_>,
    |

Check warning on line 69 in zcash_extensions/src/consensus/transparent.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
  --> zcash_extensions/src/consensus/transparent.rs:69:15
   |
69 |     fn verify<'a>(
   |               ^^
...
73 |         ctx: &Context<'a>,
   |                       ^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
   = note: `-W clippy::needless-lifetimes` implied by `-W clippy::all`
   = help: to override `-W clippy::all` add `#[allow(clippy::needless_lifetimes)]`
help: elide the lifetimes
   |
69 ~     fn verify(
70 |         &self,
71 |         precondition: &Precondition,
72 |         witness: &Witness<AuthData>,
73 ~         ctx: &Context<'_>,
   |

Check warning on line 367 in zcash_proofs/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> zcash_proofs/src/lib.rs:367:37
    |
367 |         VerifyingKey::<Bls12>::read(&mut fs)
    |                                     ^^^^^^^ help: change this to: `fs`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
    = note: `-W clippy::needless-borrows-for-generic-args` implied by `-W clippy::all`
    = help: to override `-W clippy::all` add `#[allow(clippy::needless_borrows_for_generic_args)]`

Check warning on line 322 in zcash_proofs/src/sapling/zip304.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

using `clone` on type `SubgroupPoint` which implements the `Copy` trait

warning: using `clone` on type `SubgroupPoint` which implements the `Copy` trait
   --> zcash_proofs/src/sapling/zip304.rs:322:15
    |
322 |         pk_d: payment_address.pk_d().clone(),
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*payment_address.pk_d()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 216 in zcash_proofs/src/sapling/zip304.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

using `clone` on type `SubgroupPoint` which implements the `Copy` trait

warning: using `clone` on type `SubgroupPoint` which implements the `Copy` trait
   --> zcash_proofs/src/sapling/zip304.rs:216:19
    |
216 |         PublicKey(proof_generation_key.ak.clone().into()).randomize(alpha, SPENDING_KEY_GENERATOR);
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `proof_generation_key.ak`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 184 in zcash_proofs/src/sapling/zip304.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

using `clone` on type `SubgroupPoint` which implements the `Copy` trait

warning: using `clone` on type `SubgroupPoint` which implements the `Copy` trait
   --> zcash_proofs/src/sapling/zip304.rs:184:15
    |
184 |         pk_d: payment_address.pk_d().clone(),
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*payment_address.pk_d()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
    = note: `-W clippy::clone-on-copy` implied by `-W clippy::all`
    = help: to override `-W clippy::all` add `#[allow(clippy::clone_on_copy)]`

Check warning on line 460 in zcash_proofs/src/circuit/sprout/mod.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

used `unwrap()` on `Some` value

warning: used `unwrap()` on `Some` value
   --> zcash_proofs/src/circuit/sprout/mod.rs:460:40
    |
460 |             .write_u64::<LittleEndian>(vpub_new.unwrap())
    |                                        ^^^^^^^^^^^^^^^^^
    |
help: remove the `Some` and `unwrap()`
   --> zcash_proofs/src/circuit/sprout/mod.rs:413:24
    |
413 |         let vpub_new = Some(test_vector.read_u64::<LittleEndian>().unwrap());
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap

Check warning on line 457 in zcash_proofs/src/circuit/sprout/mod.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

used `unwrap()` on `Some` value

warning: used `unwrap()` on `Some` value
   --> zcash_proofs/src/circuit/sprout/mod.rs:457:40
    |
457 |             .write_u64::<LittleEndian>(vpub_old.unwrap())
    |                                        ^^^^^^^^^^^^^^^^^
    |
help: remove the `Some` and `unwrap()`
   --> zcash_proofs/src/circuit/sprout/mod.rs:412:24
    |
412 |         let vpub_old = Some(test_vector.read_u64::<LittleEndian>().unwrap());
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap

Check warning on line 449 in zcash_proofs/src/circuit/sprout/mod.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

used `unwrap()` on `Some` value

warning: used `unwrap()` on `Some` value
   --> zcash_proofs/src/circuit/sprout/mod.rs:449:32
    |
449 |         expected_inputs.extend(h_sig.unwrap().to_vec());
    |                                ^^^^^^^^^^^^^^
    |
help: remove the `Some` and `unwrap()`
   --> zcash_proofs/src/circuit/sprout/mod.rs:362:21
    |
362 |         let h_sig = Some(get_u256(&mut test_vector));
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap

Check warning on line 448 in zcash_proofs/src/circuit/sprout/mod.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

used `unwrap()` on `Some` value

warning: used `unwrap()` on `Some` value
   --> zcash_proofs/src/circuit/sprout/mod.rs:448:32
    |
448 |         expected_inputs.extend(rt.unwrap().to_vec());
    |                                ^^^^^^^^^^^
    |
help: remove the `Some` and `unwrap()`
   --> zcash_proofs/src/circuit/sprout/mod.rs:361:18
    |
361 |         let rt = Some(get_u256(&mut test_vector));
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap
    = note: `-W clippy::unnecessary-literal-unwrap` implied by `-W clippy::all`
    = help: to override `-W clippy::all` add `#[allow(clippy::unnecessary_literal_unwrap)]`

Check warning on line 69 in zcash_proofs/src/circuit/sprout/input.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy (beta)

dereferencing a tuple pattern where every element takes a reference

warning: dereferencing a tuple pattern where every element takes a reference
  --> zcash_proofs/src/circuit/sprout/input.rs:69:37
   |
69 |                 layer.as_ref().map(|&(ref sibling, _)| &sibling[..]),
   |                                     ^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference
   = note: `-W clippy::needless-borrowed-reference` implied by `-W clippy::all`
   = help: to override `-W clippy::all` add `#[allow(clippy::needless_borrowed_reference)]`
help: try removing the `&` and `ref` parts
   |
69 -                 layer.as_ref().map(|&(ref sibling, _)| &sibling[..]),
69 +                 layer.as_ref().map(|(sibling, _)| &sibling[..]),
   |