Skip to content

partially fixing errors in zk memory #15

partially fixing errors in zk memory

partially fixing errors in zk memory #15

GitHub Actions / Clippy failed Nov 21, 2023 in 0s

Clippy

13 errors

Details

Results

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

Versions

  • rustc 1.74.0 (79e9716c9 2023-11-13)
  • cargo 1.74.0 (ecb9851af 2023-10-18)
  • clippy 0.1.74 (79e9716 2023-11-13)

Annotations

Check failure on line 90 in libecvrf/src/helper.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy

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

error: this expression creates a reference which is immediately dereferenced by the compiler
  --> libecvrf/src/helper.rs:90:33
   |
90 |     context.ecmult_gen(&mut rj, &ng);
   |                                 ^^^ help: change this to: `ng`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
   = note: `#[deny(clippy::needless_borrow)]` implied by `#[deny(warnings)]`

Check failure on line 33 in libecvrf/src/helper.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy

field assignment outside of initializer for an instance created with Default::default()

error: field assignment outside of initializer for an instance created with Default::default()
  --> libecvrf/src/helper.rs:33:5
   |
33 |     c.x = a.x * b.x;
   |     ^^^^^^^^^^^^^^^^
   |
note: consider initializing the variable with `libsecp256k1::curve::Affine { x: a.x * b.x, y: a.y * b.y, ..Default::default() }` and removing relevant reassignments
  --> libecvrf/src/helper.rs:32:5
   |
32 |     let mut c = Affine::default();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default

Check failure on line 23 in libecvrf/src/helper.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy

field assignment outside of initializer for an instance created with Default::default()

error: field assignment outside of initializer for an instance created with Default::default()
  --> libecvrf/src/helper.rs:23:5
   |
23 |     c.x = b.y * a.x + a.y * b.x.neg(1);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: consider initializing the variable with `libsecp256k1::curve::Affine { x: b.y * a.x + a.y * b.x.neg(1), y: a.y * b.y, ..Default::default() }` and removing relevant reassignments
  --> libecvrf/src/helper.rs:22:5
   |
22 |     let mut c = Affine::default();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default

Check failure on line 68 in libecvrf/src/hash.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy

writing `&Vec` instead of `&[_]` involves a new object where a slice will do

error: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> libecvrf/src/hash.rs:68:22
   |
68 | pub fn field_hash(b: &Vec<u8>) -> Field {
   |                      ^^^^^^^^ help: change this to: `&[u8]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

Check failure on line 47 in libecvrf/src/hash.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy

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

error: using `clone` on type `Affine` which implements the `Copy` trait
  --> libecvrf/src/hash.rs:47:19
   |
47 |     let mut tpk = pk.clone();
   |                   ^^^^^^^^^^ help: try dereferencing it: `*pk`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check failure on line 32 in libecvrf/src/hash.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy

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

error: using `clone` on type `Field` which implements the `Copy` trait
  --> libecvrf/src/hash.rs:32:17
   |
32 |     let mut t = x.clone();
   |                 ^^^^^^^^^ help: try dereferencing it: `*x`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check failure on line 17 in libecvrf/src/hash.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy

field assignment outside of initializer for an instance created with Default::default()

error: field assignment outside of initializer for an instance created with Default::default()
  --> libecvrf/src/hash.rs:17:5
   |
17 |     r.x = field_hash(b);
   |     ^^^^^^^^^^^^^^^^^^^^
   |
note: consider initializing the variable with `libsecp256k1::curve::Affine { x: field_hash(b), ..Default::default() }` and removing relevant reassignments
  --> libecvrf/src/hash.rs:15:5
   |
15 |     let mut r = Affine::default();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
   = note: `#[deny(clippy::field_reassign_with_default)]` implied by `#[deny(warnings)]`

Check failure on line 31 in libecvrf/src/extends.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy

writing `&Vec` instead of `&[_]` involves a new object where a slice will do

error: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> libecvrf/src/extends.rs:31:21
   |
31 |     fn keccak256(a: &Vec<u8>) -> Self;
   |                     ^^^^^^^^ help: change this to: `&[u8]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
   = note: `#[deny(clippy::ptr_arg)]` implied by `#[deny(warnings)]`

Check failure on line 298 in libecvrf/src/ecvrf.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy

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

error: using `clone` on type `Scalar` which implements the `Copy` trait
   --> libecvrf/src/ecvrf.rs:298:25
    |
298 |         let mut neg_c = c.clone();
    |                         ^^^^^^^^^ help: try removing the `clone` call: `c`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check failure on line 230 in libecvrf/src/ecvrf.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy

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

error: using `clone` on type `Scalar` which implements the `Copy` trait
   --> libecvrf/src/ecvrf.rs:230:25
    |
230 |         let mut neg_c = c.clone();
    |                         ^^^^^^^^^ help: try removing the `clone` call: `c`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check failure on line 125 in libecvrf/src/ecvrf.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy

using `clone` on type `[u8; 32]` which implements the `Copy` trait

error: using `clone` on type `[u8; 32]` which implements the `Copy` trait
   --> libecvrf/src/ecvrf.rs:125:25
    |
125 |             secret_key: value.clone(),
    |                         ^^^^^^^^^^^^^ help: try dereferencing it: `*value`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
    = note: `#[deny(clippy::clone_on_copy)]` implied by `#[deny(warnings)]`

Check failure on line 52 in libecvrf/src/ecvrf.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy

you should consider adding a `Default` implementation for `KeyPair`

error: you should consider adding a `Default` implementation for `KeyPair`
  --> libecvrf/src/ecvrf.rs:44:5
   |
44 | /     pub fn new() -> Self {
45 | |         let mut rng = thread_rng();
46 | |         let secret_key = SecretKey::random(&mut rng);
47 | |         let public_key = PublicKey::from_secret_key(&secret_key);
...  |
51 | |         }
52 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
   = note: `#[deny(clippy::new_without_default)]` implied by `#[deny(warnings)]`
help: try adding this
   |
42 + impl Default for KeyPair {
43 +     fn default() -> Self {
44 +         Self::new()
45 +     }
46 + }
   |

Check failure on line 182 in libecvrf/src/ecvrf.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy

redundant field names in struct initialization

error: redundant field names in struct initialization
   --> libecvrf/src/ecvrf.rs:182:13
    |
182 |             secret_key: secret_key,
    |             ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret_key`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
note: the lint level is defined here
   --> libecvrf/src/lib.rs:5:5
    |
5   |     warnings,
    |     ^^^^^^^^
    = note: `#[deny(clippy::redundant_field_names)]` implied by `#[deny(warnings)]`