Skip to content

Code style fixes

Code style fixes #231

GitHub Actions / clippy failed Oct 26, 2023 in 0s

clippy

1 error, 11 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 1
Warning 11
Note 0
Help 0

Versions

  • rustc 1.73.0 (cc66ad468 2023-10-03)
  • cargo 1.73.0 (9c4383fb5 2023-08-26)
  • clippy 0.1.73 (cc66ad4 2023-10-03)

Annotations

Check failure on line 63 in libzeropool-rs-wasm/src/client/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

struct takes 1 generic argument but 2 generic arguments were supplied

error[E0107]: struct takes 1 generic argument but 2 generic arguments were supplied
   --> libzeropool-rs-wasm/src/client/mod.rs:63:23
    |
63  |     inner: Rc<RefCell<NativeUserAccount<Database, PoolParams>>>,
    |                       ^^^^^^^^^^^^^^^^^           ---------- help: remove this generic argument
    |                       |
    |                       expected 1 generic argument
    |
note: struct defined here, with 1 generic parameter: `P`
   --> /home/runner/work/libzeropool-rs/libzeropool-rs/libzeropool-rs/src/client/mod.rs:108:12
    |
108 | pub struct UserAccount<P: PoolParams> {
    |            ^^^^^^^^^^^ -

Check warning on line 26 in libzeropool-rs-wasm/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

ambiguous glob re-exports

warning: ambiguous glob re-exports
  --> libzeropool-rs-wasm/src/lib.rs:21:9
   |
21 |   pub use crate::{
   |  _________^
22 | |     client::*,
23 | |     proof::*,
24 | |     state::{Transaction, UserState},
25 | |     ts_types::*,
   | |     ----------- but the name `Proof` in the type namespace is also re-exported here
26 | | };
   | |_^ the name `Proof` in the type namespace is first re-exported here
   |
   = note: `#[warn(ambiguous_glob_reexports)]` on by default

Check warning on line 112 in libs/kvdb-web/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

deref which would be done by auto-deref

warning: deref which would be done by auto-deref
   --> libs/kvdb-web/src/lib.rs:112:52
    |
112 |         let _ = indexed_db::idb_commit_transaction(&*self.indexed_db, &transaction, self.columns);
    |                                                    ^^^^^^^^^^^^^^^^^ help: try: `&self.indexed_db`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref

Check warning on line 112 in libs/kvdb-web/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

non-binding `let` on a future

warning: non-binding `let` on a future
   --> libs/kvdb-web/src/lib.rs:112:9
    |
112 |         let _ = indexed_db::idb_commit_transaction(&*self.indexed_db, &transaction, self.columns);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: consider awaiting the future or dropping explicitly with `std::mem::drop`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future
    = note: `#[warn(clippy::let_underscore_future)]` on by default

Check warning on line 67 in libs/kvdb-web/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

deref which would be done by auto-deref

warning: deref which would be done by auto-deref
  --> libs/kvdb-web/src/lib.rs:67:53
   |
67 |             let mut stream = indexed_db::idb_cursor(&*inner, column);
   |                                                     ^^^^^^^ help: try: `&inner`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
   = note: `#[warn(clippy::explicit_auto_deref)]` on by default

Check warning on line 17 in libzeropool-rs/src/utils.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
  --> libzeropool-rs/src/utils.rs:17:14
   |
17 |         .zip(hasher.finalize().into_iter())
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `hasher.finalize()`
   |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
  --> /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/iter/traits/iterator.rs:642:12
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
   = note: `#[warn(clippy::useless_conversion)]` on by default

Check warning on line 347 in libzeropool-rs/src/merkle.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

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> libzeropool-rs/src/merkle.rs:347:13
    |
347 |             &update_boundaries,
    |             ^^^^^^^^^^^^^^^^^^ help: change this to: `update_boundaries`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `#[warn(clippy::needless_borrow)]` on by default

Check warning on line 115 in libzeropool-rs/src/client/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this lifetime isn't used in the impl

warning: this lifetime isn't used in the impl
   --> libzeropool-rs/src/client/mod.rs:115:6
    |
115 | impl<'p, P> UserAccount<P>
    |      ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes
    = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default

Check warning on line 27 in libzeropool-rs/src/client/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused imports: `State`, `Transaction`

warning: unused imports: `State`, `Transaction`
  --> libzeropool-rs/src/client/mod.rs:27:19
   |
27 | use self::state::{State, Transaction};
   |                   ^^^^^  ^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

Check warning on line 205 in libs/kvdb-persy/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

question mark operator is useless here

warning: question mark operator is useless here
   --> libs/kvdb-persy/src/lib.rs:200:29
    |
200 | / ...                   Ok(tx
201 | | ...                       .one::<PersyId, String>(&index_id_to_k, rec_id)
202 | | ...                       .map_err(persy_to_io)?
203 | | ...                       .ok_or_else(|| {
204 | | ...                           std::io::Error::new(std::io::ErrorKind::Other, "Key not found")
205 | | ...                       })?)
    | |______________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
    = note: `#[warn(clippy::needless_question_mark)]` on by default
help: try removing question mark and `Ok()`
    |
200 ~                             tx
201 +                                 .one::<PersyId, String>(&index_id_to_k, rec_id)
202 +                                 .map_err(persy_to_io)?
203 +                                 .ok_or_else(|| {
204 +                                     std::io::Error::new(std::io::ErrorKind::Other, "Key not found")
205 +                                 })
    |

Check warning on line 117 in libs/kvdb-persy/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> libs/kvdb-persy/src/lib.rs:117:22
    |
117 |         self.db.read(&col.to_string(), &rec_id).map_err(persy_to_io)
    |                      ^^^^^^^^^^^^^^^^ help: change this to: `col.to_string()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 100 in libs/kvdb-persy/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> libs/kvdb-persy/src/lib.rs:100:37
    |
100 |             let data = self.db.read(&segment, &id).map_err(persy_to_io)?;
    |                                     ^^^^^^^^ help: change this to: `segment`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `#[warn(clippy::needless_borrow)]` on by default