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

clippy

94 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 94
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 420 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:420:41
    |
420 |                         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 418 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:418:24
    |
418 |                 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 345 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:345:37
    |
345 |                     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 326 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:326:26
    |
326 |                         .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 308 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:308:22
    |
308 |                     .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 291 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:291:37
    |
291 |                     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 116 in grovedb/src/query_result_type.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
   --> grovedb/src/query_result_type.rs:116:78
    |
116 |         String::from_utf8(hex_value.to_vec()).unwrap_or_else(|_| hex::encode(&hex_value))
    |                                                                              ^^^^^^^^^^ help: change this to: `hex_value`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 114 in grovedb/src/query_result_type.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
   --> grovedb/src/query_result_type.rs:114:21
    |
114 |         hex::encode(&hex_value)
    |                     ^^^^^^^^^^ help: change this to: `hex_value`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

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

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant closure

warning: redundant closure
   --> grovedb/src/query/mod.rs:463:22
    |
463 |                 .map(|conditional_subquery_branches| Cow::Borrowed(conditional_subquery_branches)),
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `Cow::Borrowed`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure

Check warning on line 439 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:439:9
    |
439 |         return false;
    |         ^^^^^^^^^^^^
    |
    = 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`
    |
439 -         return false;
439 +         false
    |

Check warning on line 350 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:346:29
    |
346 | / ...                   if let Some(subquery) = &query.default_subquery_branch.subquery {
347 | | ...                       Some(InternalCowItemsQuery::from_query(subquery))
348 | | ...                   } else {
349 | | ...                       None
350 | | ...                   }
    | |_______________________^ 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 315 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:311:41
    |
311 | / ...                   if let Some(subquery) = &subquery_branch.subquery {
312 | | ...                       Some(InternalCowItemsQuery::from_query(subquery))
313 | | ...                   } else {
314 | | ...                       None
315 | | ...                   }
    | |_______________________^ 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 288 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:288:32
    |
288 |     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
    |
288 -     pub fn query_items_at_path<'a>(&'a self, path: &[&[u8]]) -> Option<InternalCowItemsQuery> {
288 +     pub fn query_items_at_path(&self, path: &[&[u8]]) -> Option<InternalCowItemsQuery> {
    |

Check warning on line 55 in grovedb/src/query/mod.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
  --> grovedb/src/query/mod.rs:55:78
   |
55 |         String::from_utf8(hex_value.to_vec()).unwrap_or_else(|_| hex::encode(&hex_value))
   |                                                                              ^^^^^^^^^^ help: change this to: `hex_value`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 53 in grovedb/src/query/mod.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
  --> grovedb/src/query/mod.rs:53:21
   |
53 |         hex::encode(&hex_value)
   |                     ^^^^^^^^^^ help: change this to: `hex_value`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 209 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:209:9
    |
209 |         options: &VerifyOptions,
    |         ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_options`
    |
note: parameter used here
   --> grovedb/src/operations/proof/verify.rs:278:37
    |
278 | ...                   options,
    |                       ^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion

Check warning on line 204 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:204:9
    |
204 |         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:273:37
    |
273 | ...                   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 317 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:317:25
    |
317 |                         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