feat!: proof system v1 (from v0.1) #301
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
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
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
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
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
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
Check warning on line 92 in grovedb/src/reference_path.rs
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
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
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
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
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
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
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
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 499 in grovedb/src/query/mod.rs
github-actions / clippy
redundant closure
warning: redundant closure
--> grovedb/src/query/mod.rs:499:22
|
499 | .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 460 in grovedb/src/query/mod.rs
github-actions / clippy
redundant closure
warning: redundant closure
--> grovedb/src/query/mod.rs:460:22
|
460 | .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 449 in grovedb/src/query/mod.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> grovedb/src/query/mod.rs:449:9
|
449 | 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`
|
449 - return false;
449 + false
|
Check warning on line 352 in grovedb/src/query/mod.rs
github-actions / clippy
length comparison to zero
warning: length comparison to zero
--> grovedb/src/query/mod.rs:352:35
|
352 | } else if path_after_top_removed.len() == 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `path_after_top_removed.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
Check warning on line 351 in grovedb/src/query/mod.rs
github-actions / clippy
manual implementation of `Option::map`
warning: manual implementation of `Option::map`
--> grovedb/src/query/mod.rs:347:29
|
347 | / ... if let Some(subquery) = &query.default_subquery_branch.subquery {
348 | | ... Some(InternalCowItemsQuery::from_query(subquery))
349 | | ... } else {
350 | | ... None
351 | | ... }
| |_______________________^ 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 309 in grovedb/src/query/mod.rs
github-actions / clippy
length comparison to zero
warning: length comparison to zero
--> grovedb/src/query/mod.rs:309:47
|
309 | ... } else if path_after_top_removed.len() == 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `path_after_top_removed.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 308 in grovedb/src/query/mod.rs
github-actions / clippy
manual implementation of `Option::map`
warning: manual implementation of `Option::map`
--> grovedb/src/query/mod.rs:304:41
|
304 | / ... if let Some(subquery) = &subquery_branch.subquery {
305 | | ... Some(InternalCowItemsQuery::from_query(subquery))
306 | | ... } else {
307 | | ... None
308 | | ... }
| |_______________________^ 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 281 in grovedb/src/query/mod.rs
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:281:32
|
281 | 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
|
281 - pub fn query_items_at_path<'a>(&'a self, path: &[&[u8]]) -> Option<InternalCowItemsQuery> {
281 + pub fn query_items_at_path(&self, path: &[&[u8]]) -> Option<InternalCowItemsQuery> {
|
Check warning on line 179 in grovedb/src/operations/proof/verify.rs
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:253:37
|
253 | ... 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 300 in grovedb/src/operations/proof/verify.rs
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:300:25
|
300 | 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 235 in grovedb/src/operations/proof/verify.rs
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:235:13
|
235 | 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
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 + ))?;
|