Skip to content

change zcash_extra edition to 2018 #103

change zcash_extra edition to 2018

change zcash_extra edition to 2018 #103

This check has been archived and is scheduled for deletion. Learn more about checks retention
GitHub Actions / Clippy (nightly) succeeded Oct 11, 2023 in 3s

Clippy (nightly)

199 warnings

Details

Results

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

Versions

  • rustc 1.75.0-nightly (d627cf07c 2023-10-10)
  • cargo 1.75.0-nightly (794d0a825 2023-10-03)
  • clippy 0.1.75 (d627cf0 2023-10-10)

Annotations

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

See this annotation in the file changed.

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

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> zcash_proofs/src/lib.rs:163:37
    |
163 |         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 161 in zcash_proofs/src/sapling/verifier.rs

See this annotation in the file changed.

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

this expression borrows a value the compiler would automatically borrow

warning: this expression borrows a value the compiler would automatically borrow
   --> zcash_proofs/src/sapling/verifier.rs:161:9
    |
161 |         (&mut data_to_be_signed[32..64]).copy_from_slice(&sighash_value[..]);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `data_to_be_signed[32..64]`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 62 in zcash_proofs/src/sapling/verifier.rs

See this annotation in the file changed.

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

this expression borrows a value the compiler would automatically borrow

warning: this expression borrows a value the compiler would automatically borrow
  --> zcash_proofs/src/sapling/verifier.rs:62:9
   |
62 |         (&mut data_to_be_signed[32..64]).copy_from_slice(&sighash_value[..]);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `data_to_be_signed[32..64]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 247 in zcash_proofs/src/sapling/prover.rs

See this annotation in the file changed.

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

this expression borrows a value the compiler would automatically borrow

warning: this expression borrows a value the compiler would automatically borrow
   --> zcash_proofs/src/sapling/prover.rs:247:9
    |
247 |         (&mut data_to_be_signed[32..64]).copy_from_slice(&sighash[..]);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `data_to_be_signed[32..64]`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 90 in zcash_proofs/src/sapling/prover.rs

See this annotation in the file changed.

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

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/prover.rs:90:23
   |
90 |             PublicKey(proof_generation_key.ak.clone().into()).randomize(ar, 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
   = 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 (nightly)

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 (nightly)

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 (nightly)

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 (nightly)

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 495 in components/equihash/src/verify.rs

See this annotation in the file changed.

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

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> components/equihash/src/verify.rs:495:77
    |
495 |                 is_valid_solution_recursive(tv.params, tv.input, &tv.nonce, &tv.solution)
    |                                                                             ^^^^^^^^^^^^ help: change this to: `tv.solution`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 489 in components/equihash/src/verify.rs

See this annotation in the file changed.

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

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> components/equihash/src/verify.rs:489:77
    |
489 |                 is_valid_solution_iterative(tv.params, tv.input, &tv.nonce, &tv.solution)
    |                                                                             ^^^^^^^^^^^^ help: change this to: `tv.solution`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 317 in components/equihash/src/verify.rs

See this annotation in the file changed.

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

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> components/equihash/src/verify.rs:317:26
    |
317 |         Ok(Node::new(&p, &state, indices[0]))
    |                          ^^^^^^ help: change this to: `state`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 317 in components/equihash/src/verify.rs

See this annotation in the file changed.

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

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> components/equihash/src/verify.rs:317:22
    |
317 |         Ok(Node::new(&p, &state, indices[0]))
    |                      ^^ help: change this to: `p`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `-W clippy::needless-borrow` implied by `-W clippy::all`
    = help: to override `-W clippy::all` add `#[allow(clippy::needless_borrow)]`

Check warning on line 224 in components/equihash/src/verify.rs

See this annotation in the file changed.

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

usage of `mem::size_of::<T>()` to obtain the size of `T` in bits

warning: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
   --> components/equihash/src/verify.rs:224:23
    |
224 |     let len_indices = 8 * size_of::<u32>() * minimal.len() / (c_bit_len + 1);
    |                       ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u32::BITS as usize`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_bits

Check warning on line 173 in components/equihash/src/verify.rs

See this annotation in the file changed.

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

usage of `mem::size_of::<T>()` to obtain the size of `T` in bits

warning: usage of `mem::size_of::<T>()` to obtain the size of `T` in bits
   --> components/equihash/src/verify.rs:173:13
    |
173 |     assert!(8 * size_of::<u32>() >= 7 + bit_len);
    |             ^^^^^^^^^^^^^^^^^^^^ help: consider using: `u32::BITS as usize`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_bits
    = note: `-W clippy::manual-bits` implied by `-W clippy::all`
    = help: to override `-W clippy::all` add `#[allow(clippy::manual_bits)]`

Check warning on line 461 in components/zcash_note_encryption/src/lib.rs

See this annotation in the file changed.

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

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> components/zcash_note_encryption/src/lib.rs:461:31
    |
461 |             .open_to(&mut op, &out_ciphertext, &[], ock.as_ref(), &[0u8; 12])
    |                               ^^^^^^^^^^^^^^^ help: change this to: `out_ciphertext`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 423 in components/zcash_note_encryption/src/lib.rs

See this annotation in the file changed.

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

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> components/zcash_note_encryption/src/lib.rs:423:41
    |
423 |     let shared_secret = D::ka_agree_dec(&ivk, output.epk());
    |                                         ^^^^ help: change this to: `ivk`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 392 in components/zcash_note_encryption/src/lib.rs

See this annotation in the file changed.

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

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> components/zcash_note_encryption/src/lib.rs:392:57
    |
392 |             if D::epk_bytes(&D::ka_derive_public(&note, &derived_esk))
    |                                                         ^^^^^^^^^^^^ help: change this to: `derived_esk`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 392 in components/zcash_note_encryption/src/lib.rs

See this annotation in the file changed.

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

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> components/zcash_note_encryption/src/lib.rs:392:50
    |
392 |             if D::epk_bytes(&D::ka_derive_public(&note, &derived_esk))
    |                                                  ^^^^^ help: change this to: `note`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 391 in components/zcash_note_encryption/src/lib.rs

See this annotation in the file changed.

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

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> components/zcash_note_encryption/src/lib.rs:391:28
    |
391 |         D::check_epk_bytes(&note, |derived_esk| {
    |                            ^^^^^ help: change this to: `note`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 387 in components/zcash_note_encryption/src/lib.rs

See this annotation in the file changed.

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

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> components/zcash_note_encryption/src/lib.rs:387:56
    |
387 |     if D::ExtractedCommitmentBytes::try_from(D::cmstar(&note))
    |                                                        ^^^^^ help: change this to: `note`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 373 in components/zcash_note_encryption/src/lib.rs

See this annotation in the file changed.

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

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> components/zcash_note_encryption/src/lib.rs:373:72
    |
373 |     let (note, to) = domain.parse_note_plaintext_without_memo_ivk(ivk, &plaintext)?;
    |                                                                        ^^^^^^^^^^ help: change this to: `plaintext`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 295 in components/zcash_note_encryption/src/lib.rs

See this annotation in the file changed.

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

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> components/zcash_note_encryption/src/lib.rs:295:47
    |
295 |             let ock = D::derive_ock(ovk, &cv, &cmstar, &D::epk_bytes(&self.epk));
    |                                               ^^^^^^^ help: change this to: `cmstar`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 295 in components/zcash_note_encryption/src/lib.rs

See this annotation in the file changed.

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

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> components/zcash_note_encryption/src/lib.rs:295:42
    |
295 |             let ock = D::derive_ock(ovk, &cv, &cmstar, &D::epk_bytes(&self.epk));
    |                                          ^^^ help: change this to: `cv`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `-W clippy::needless-borrow` implied by `-W clippy::all`
    = help: to override `-W clippy::all` add `#[allow(clippy::needless_borrow)]`

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

See this annotation in the file changed.

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

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
   --> zcash_extensions/src/transparent/demo.rs:102:12
    |
102 |     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
    |
102 -     fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> fmt::Result {
102 +     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    |