Skip to content
GitHub Actions / clippy succeeded Jul 8, 2024 in 1s

clippy

93 warnings

Details

Results

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

Versions

  • rustc 1.79.0 (129f3b996 2024-06-10)
  • cargo 1.79.0 (ffa9cf99a 2024-06-03)
  • clippy 0.1.79 (129f3b9 2024-06-10)

Annotations

Check warning on line 670 in /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/macros/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `std::result::Result` that must be used

warning: unused `std::result::Result` that must be used
  --> grovedb/src/replication.rs:86:13
   |
86 | /             writeln!(
87 | |                 f,
88 | |                 " prefix:{:?} -> path:{:?}",
89 | |                 hex::encode(prefix),
90 | |                 metadata_path_str
91 | |             );
   | |_____________^
   |
   = note: this `Result` may be an `Err` variant, which should be handled
   = note: `#[warn(unused_must_use)]` on by default
   = note: this warning originates in the macro `writeln` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 957 in grovedb/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

very complex type used. Consider factoring parts into `type` definitions

warning: very complex type used. Consider factoring parts into `type` definitions
   --> grovedb/src/lib.rs:957:10
    |
957 |     ) -> Result<HashMap<Vec<Vec<u8>>, (CryptoHash, CryptoHash, CryptoHash)>, Error> {
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity

Check warning on line 887 in grovedb/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

very complex type used. Consider factoring parts into `type` definitions

warning: very complex type used. Consider factoring parts into `type` definitions
   --> grovedb/src/lib.rs:887:10
    |
887 |     ) -> Result<HashMap<Vec<Vec<u8>>, (CryptoHash, CryptoHash, CryptoHash)>, Error> {
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity

Check warning on line 861 in grovedb/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

very complex type used. Consider factoring parts into `type` definitions

warning: very complex type used. Consider factoring parts into `type` definitions
   --> grovedb/src/lib.rs:861:10
    |
861 |     ) -> Result<HashMap<Vec<Vec<u8>>, (CryptoHash, CryptoHash, CryptoHash)>, Error> {
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
    = note: `#[warn(clippy::type_complexity)]` on by default

Check warning on line 222 in grovedb/src/reference_path.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

length comparison to zero

warning: length comparison to zero
   --> grovedb/src/reference_path.rs:222:76
    |
222 |             if usize::from(no_of_elements_to_keep) > current_path.len() || current_path.len() == 0 {
    |                                                                            ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `current_path.is_empty()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
    = note: `#[warn(clippy::len_zero)]` on by default

Check warning on line 92 in grovedb/src/reference_path.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant closure

warning: redundant closure
  --> grovedb/src/reference_path.rs:92:14
   |
92 |         .map(|segment| hex::encode(segment))
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `hex::encode`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure

Check warning on line 90 in grovedb/src/reference_path.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

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> grovedb/src/reference_path.rs:90:23
   |
90 | fn display_path(path: &Vec<Vec<u8>>) -> String {
   |                       ^^^^^^^^^^^^^ help: change this to: `&[Vec<u8>]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

Check warning on line 414 in grovedb/src/query_result_type.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

use of `or_insert_with` to construct default value

warning: use of `or_insert_with` to construct default value
   --> grovedb/src/query_result_type.rs:414:41
    |
414 |                         map.entry(last).or_insert_with(Vec::new).push(key);
    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default

Check warning on line 412 in grovedb/src/query_result_type.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant pattern matching, consider using `is_some()`

warning: redundant pattern matching, consider using `is_some()`
   --> grovedb/src/query_result_type.rs:412:24
    |
412 |                 if let Some(_) = path.pop() {
    |                 -------^^^^^^^------------- help: try: `if path.pop().is_some()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
    = note: `#[warn(clippy::redundant_pattern_matching)]` on by default

Check warning on line 339 in grovedb/src/query_result_type.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

use of `or_insert_with` to construct default value

warning: use of `or_insert_with` to construct default value
   --> grovedb/src/query_result_type.rs:339:37
    |
339 |                     map.entry(last).or_insert_with(Vec::new).push(element);
    |                                     ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default

Check warning on line 320 in grovedb/src/query_result_type.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

use of `or_insert_with` to construct default value

warning: use of `or_insert_with` to construct default value
   --> grovedb/src/query_result_type.rs:320:26
    |
320 |                         .or_insert_with(BTreeMap::new)
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default

Check warning on line 302 in grovedb/src/query_result_type.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

use of `or_insert_with` to construct default value

warning: use of `or_insert_with` to construct default value
   --> grovedb/src/query_result_type.rs:302:22
    |
302 |                     .or_insert_with(BTreeMap::new)
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default

Check warning on line 285 in grovedb/src/query_result_type.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

use of `or_insert_with` to construct default value

warning: use of `or_insert_with` to construct default value
   --> grovedb/src/query_result_type.rs:285:37
    |
285 |                     map.entry(last).or_insert_with(Vec::new).push(key);
    |                                     ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
    = note: `#[warn(clippy::unwrap_or_default)]` on by default

Check warning on line 497 in grovedb/src/query/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> grovedb/src/query/mod.rs:497:13
    |
497 |             return true;
    |             ^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
    = note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
    |
497 -             return true;
497 +             true
    |

Check warning on line 481 in grovedb/src/query/mod.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
   --> grovedb/src/query/mod.rs:481:75
    |
481 |             Some(path) => writeln!(f, "  in_path: Some({})", hex_to_ascii(&path)),
    |                                                                           ^^^^^ help: change this to: `path`
    |
    = 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 353 in grovedb/src/query/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

manual implementation of `Option::map`

warning: manual implementation of `Option::map`
   --> grovedb/src/query/mod.rs:349:29
    |
349 | / ...                   if let Some(subquery) = &query.default_subquery_branch.subquery {
350 | | ...                       Some(InternalCowItemsQuery::from_query(subquery))
351 | | ...                   } else {
352 | | ...                       None
353 | | ...                   }
    | |_______________________^ help: try: `query.default_subquery_branch.subquery.as_ref().map(|subquery| InternalCowItemsQuery::from_query(subquery))`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map

Check warning on line 312 in grovedb/src/query/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

manual implementation of `Option::map`

warning: manual implementation of `Option::map`
   --> grovedb/src/query/mod.rs:308:41
    |
308 | / ...                   if let Some(subquery) = &subquery_branch.subquery {
309 | | ...                       Some(InternalCowItemsQuery::from_query(subquery))
310 | | ...                   } else {
311 | | ...                       None
312 | | ...                   }
    | |_______________________^ help: try: `subquery_branch.subquery.as_ref().map(|subquery| InternalCowItemsQuery::from_query(subquery))`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map
    = note: `#[warn(clippy::manual_map)]` on by default

Check warning on line 285 in grovedb/src/query/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
   --> grovedb/src/query/mod.rs:285:32
    |
285 |     pub fn query_items_at_path<'a>(&'a self, path: &[&[u8]]) -> Option<InternalCowItemsQuery> {
    |                                ^^   ^^                                 ^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    = note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
    |
285 -     pub fn query_items_at_path<'a>(&'a self, path: &[&[u8]]) -> Option<InternalCowItemsQuery> {
285 +     pub fn query_items_at_path(&self, path: &[&[u8]]) -> Option<InternalCowItemsQuery> {
    |

Check warning on line 179 in grovedb/src/operations/proof/verify.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

parameter is only used in recursion

warning: parameter is only used in recursion
   --> grovedb/src/operations/proof/verify.rs:179:9
    |
179 |         prove_options: &ProveOptions,
    |         ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_prove_options`
    |
note: parameter used here
   --> grovedb/src/operations/proof/verify.rs:248:37
    |
248 | ...                   prove_options,
    |                       ^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion
    = note: `#[warn(clippy::only_used_in_recursion)]` on by default

Check warning on line 296 in grovedb/src/operations/proof/verify.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`

warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
   --> grovedb/src/operations/proof/verify.rs:296:25
    |
296 |                         limit_left.as_mut().map(|limit| *limit -= 1);
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |                         |
    |                         help: try: `if let Some(limit) = limit_left.as_mut() { ... }`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn

Check warning on line 230 in grovedb/src/operations/proof/verify.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`

warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
   --> grovedb/src/operations/proof/verify.rs:230:13
    |
230 |             limit_left.as_mut().map(|limit| *limit -= 1);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |             |
    |             help: try: `if let Some(limit) = limit_left.as_mut() { ... }`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn

Check warning on line 35 in grovedb/src/operations/proof/verify.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary operation

warning: unnecessary operation
  --> grovedb/src/operations/proof/verify.rs:33:13
   |
33 | /             query.query.limit.ok_or(Error::NotSupported(
34 | |                 "limits must be set in verify_query_with_absence_proof".to_string(),
35 | |             ))? as usize;
   | |_________________________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation
   = note: `#[warn(clippy::unnecessary_operation)]` on by default
help: statement can be reduced to
   |
33 ~             query.query.limit.ok_or(Error::NotSupported(
34 +                 "limits must be set in verify_query_with_absence_proof".to_string(),
35 +             ))?;
   |

Check warning on line 313 in grovedb/src/operations/proof/util.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
   --> grovedb/src/operations/proof/util.rs:313:31
    |
313 |         .map(|e| hex_to_ascii(*e))
    |                               ^^ help: try: `e`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref

Check warning on line 312 in grovedb/src/operations/proof/util.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`

warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
   --> grovedb/src/operations/proof/util.rs:312:10
    |
312 |     path.into_iter()
    |          ^^^^^^^^^ help: call directly: `iter`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref

Check warning on line 305 in grovedb/src/operations/proof/util.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec`

warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec`
   --> grovedb/src/operations/proof/util.rs:305:10
    |
305 |     path.into_iter()
    |          ^^^^^^^^^ help: call directly: `iter`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
    = note: `#[warn(clippy::into_iter_on_ref)]` on by default