Skip to content

fix sql init module review notes #115

fix sql init module review notes

fix sql init module review notes #115

GitHub Actions / Clippy (nightly) succeeded Nov 2, 2023 in 3s

Clippy (nightly)

218 warnings

Details

Results

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

Versions

  • rustc 1.75.0-nightly (75b064d26 2023-11-01)
  • cargo 1.75.0-nightly (b4d18d4bd 2023-10-31)
  • clippy 0.1.75 (75b064d 2023-11-01)

Annotations

Check warning on line 150 in zcash_primitives/src/extensions/transparent.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
   --> zcash_primitives/src/extensions/transparent.rs:150:13
    |
150 |             &context,
    |             ^^^^^^^^ help: change this to: `context`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

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

See this annotation in the file changed.

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

methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value

warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value
  --> zcash_primitives/src/zip32.rs:87:17
   |
87 |     fn to_index(&self) -> u32 {
   |                 ^^^^^
   |
   = help: consider choosing a less ambiguous name
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
   = note: `-W clippy::wrong-self-convention` implied by `-W clippy::all`
   = help: to override `-W clippy::all` add `#[allow(clippy::wrong_self_convention)]`

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 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 {
    |

Check warning on line 98 in zcash_extensions/src/consensus/transparent.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/consensus/transparent.rs:98:15
    |
98  |     fn verify<'a>(
    |               ^^
...
102 |         ctx: &Context<'a>,
    |                       ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
98  ~     fn verify(
99  |         &self,
100 |         precondition: &Precondition,
101 |         witness: &Witness,
102 ~         ctx: &Context<'_>,
    |

Check warning on line 67 in zcash_extensions/src/consensus/transparent.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/consensus/transparent.rs:67:15
   |
67 |     fn verify<'a>(
   |               ^^
...
71 |         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
   |
67 ~     fn verify(
68 |         &self,
69 |         precondition: &Precondition,
70 |         witness: &Witness,
71 ~         ctx: &Context<'_>,
   |

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 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 107 in zcash_primitives/src/transaction/tests.rs

See this annotation in the file changed.

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

useless use of `vec!`

warning: useless use of `vec!`
   --> zcash_primitives/src/transaction/tests.rs:96:21
    |
96  |       let txn_bytes = vec![
    |  _____________________^
97  | |         0xFF, 0xFF, 0x00, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x01, 0x52, 0x52, 0x52, 0x52,
98  | |         0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52,
99  | |         0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x00, 0x00,
...   |
106 | |         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
107 | |     ];
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
help: you can use an array directly
    |
96  ~     let txn_bytes = [0xFF, 0xFF, 0x00, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x01, 0x52, 0x52, 0x52, 0x52,
97  +         0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52,
98  +         0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x00, 0x00,
99  +         0x00, 0x00, 0x00, 0x00, 0x20, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
100 +         0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
101 +         0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x30, 0x75, 0x00, 0x00, 0x00, 0x00, 0x00,
102 +         0x00, 0x00, 0x01, 0x20, 0xd9, 0x81, 0x80, 0x87, 0xde, 0x72, 0x44, 0xab, 0xc1, 0xb5, 0xfc,
103 +         0xf2, 0x8e, 0x55, 0xe4, 0x2c, 0x7f, 0xf9, 0xc6, 0x78, 0xc0, 0x60, 0x51, 0x81, 0xf3, 0x7a,
104 +         0xc5, 0xd7, 0x41, 0x4a, 0x7b, 0x95, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00,
105 ~         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00];
    |