microsoft / Nova

Nova: High-speed recursive arguments from folding schemes
MIT License
673 stars 176 forks source link

chore: fixed clippy warning #304

Closed RyanKung closed 4 months ago

RyanKung commented 4 months ago

@microsoft-github-policy-service agree [company="{Rings Network}"]

RyanKung commented 4 months ago

@microsoft-github-policy-service agree company="rings network"

srinathsetty commented 4 months ago

What command did you use to get the clippy warning? Clippy checks are part of the CI and there has been no error related to this.

RyanKung commented 4 months ago

@srinathsetty here is my clippy cmd

➜  Nova git:(main) cargo clippy --all --no-deps
    Checking nova-snark v0.34.0 (/Users/ryan/Dev/bns/Nova)
error: field `0` is never read
  --> src/bellpepper/test_shape_cs.rs:19:14
   |
19 |   Constraint(usize),
   |   ---------- ^^^^^
   |   |
   |   field in this variant
   |
note: the lint level is defined here
  --> src/lib.rs:4:3
   |
4  |   unused,
   |   ^^^^^^
   = note: `#[deny(dead_code)]` implied by `#[deny(unused)]`
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
19 |   Constraint(()),
   |              ~~

error: field `0` is never read
  --> src/bellpepper/test_shape_cs.rs:20:7
   |
20 |   Var(Variable),
   |   --- ^^^^^^^^
   |   |
   |   field in this variant
   |
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
20 |   Var(()),
   |       ~~

error: missing documentation for a type alias
  --> src/r1cs/mod.rs:81:1
   |
81 | pub type CommitmentKeyHint<E> = dyn Fn(&R1CSShape<E>) -> usize;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: the lint level is defined here
  --> src/lib.rs:8:3
   |
8  |   missing_docs
   |   ^^^^^^^^^^^^

error: missing documentation for a method
   --> src/r1cs/mod.rs:168:3
    |
168 | /   pub fn multiply_vec(
169 | |     &self,
170 | |     z: &[E::Scalar],
171 | |   ) -> Result<(Vec<E::Scalar>, Vec<E::Scalar>, Vec<E::Scalar>), NovaError> {
    | |__________________________________________________________________________^

error: could not compile `nova-snark` (lib) due to 4 previous errors
RyanKung commented 4 months ago

My clippy version is:

➜  Nova git:(main) cargo clippy --version
clippy 0.1.77 (75c68cfd 2024-01-07)
RyanKung commented 4 months ago

@srinathsetty And there is also a doc fmt issue, maybe a doc style checker should be added to CI.

➜  Nova git:(main) cargo doc --open
 Documenting nova-snark v0.34.0 (/Users/ryan/Dev/bns/Nova)
error: missing documentation for a type alias
  --> src/r1cs/mod.rs:81:1
   |
81 | pub type CommitmentKeyHint<E> = dyn Fn(&R1CSShape<E>) -> usize;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: the lint level is defined here
  --> src/lib.rs:8:3
   |
8  |   missing_docs
   |   ^^^^^^^^^^^^

error: missing documentation for a method
   --> src/r1cs/mod.rs:168:3
    |
168 | /   pub fn multiply_vec(
169 | |     &self,
170 | |     z: &[E::Scalar],
171 | |   ) -> Result<(Vec<E::Scalar>, Vec<E::Scalar>, Vec<E::Scalar>), NovaError> {
    | |__________________________________________________________________________^

error: this URL is not a hyperlink
 --> src/provider/hyperkzg.rs:2:122
  |
2 | //! HyperKZG is based on the transformation from univariate PCS to multilinear PCS in the Gemini paper (section 2.4.2 in https://eprint.iacr.org/2022/420.pdf).
  |                                                                                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://eprint.iacr.org/2022/420.pdf>`
  |
  = note: bare URLs are not automatically turned into clickable links
note: the lint level is defined here
 --> src/lib.rs:3:3
  |
3 |   warnings,
  |   ^^^^^^^^
  = note: `#[deny(rustdoc::bare_urls)]` implied by `#[deny(warnings)]`

error: could not document `nova-snark`
srinathsetty commented 4 months ago

@srinathsetty And there is also a doc fmt issue, maybe a doc style checker should be added to CI.

I think this doc error might be an issue with the r1cs module public. There's a check for missing docs in src/lib.rs.

RyanKung commented 4 months ago

@srinathsetty And there is also a doc fmt issue, maybe a doc style checker should be added to CI.

I think this doc error might be an issue with the r1cs module public. There's a check for missing docs in src/lib.rs.

Yes, I forgot to reset to the origin commit, sorry. Without public r1cs module, cargo doc works fine.

RyanKung commented 4 months ago

I see the issue is fixed by #[allow(deadcode], So I close this PR. Thx.