Skip to content

partially fixing errors in zk memory #16

partially fixing errors in zk memory

partially fixing errors in zk memory #16

Triggered via pull request November 21, 2023 08:14
Status Success
Total duration 1m 48s
Artifacts

ci.yml

on: pull_request
Fit to window
Zoom out
Zoom in

Annotations

13 errors and 18 warnings
this expression creates a reference which is immediately dereferenced by the compiler: libecvrf/src/helper.rs#L90
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)]`
field assignment outside of initializer for an instance created with Default::default(): libecvrf/src/helper.rs#L33
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
field assignment outside of initializer for an instance created with Default::default(): libecvrf/src/helper.rs#L23
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
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: libecvrf/src/hash.rs#L68
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
using `clone` on type `Affine` which implements the `Copy` trait: libecvrf/src/hash.rs#L47
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
using `clone` on type `Field` which implements the `Copy` trait: libecvrf/src/hash.rs#L32
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
field assignment outside of initializer for an instance created with Default::default(): libecvrf/src/hash.rs#L17
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)]`
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: libecvrf/src/extends.rs#L31
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)]`
using `clone` on type `Scalar` which implements the `Copy` trait: libecvrf/src/ecvrf.rs#L298
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
using `clone` on type `Scalar` which implements the `Copy` trait: libecvrf/src/ecvrf.rs#L230
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
using `clone` on type `[u8; 32]` which implements the `Copy` trait: libecvrf/src/ecvrf.rs#L125
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)]`
you should consider adding a `Default` implementation for `KeyPair`: libecvrf/src/ecvrf.rs#L44
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 + } |
redundant field names in struct initialization: libecvrf/src/ecvrf.rs#L182
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)]`
Rustfmt
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Rustfmt
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Rustfmt
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Rustfmt
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Rustfmt
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Build
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Build
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Build
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Build
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Build
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Build
output filename collision.
Test
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Test
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test: zkmemory/examples/256bits-machine.rs#L5
unused import: `commitment::kzg::KZGMemoryCommitment`
Test
`zkmemory` (example "256bits-machine") generated 1 warning (run `cargo fix --example "256bits-machine"` to apply 1 suggestion)