feat!: proof system v1 (from v0.1) #313
clippy
76 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 76 |
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 956 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:956:10
|
956 | ) -> 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 886 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:886:10
|
886 | ) -> 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 860 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:860:10
|
860 | ) -> 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
= note: `#[warn(clippy::len_zero)]` on by default
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 496 in grovedb/src/query/mod.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> grovedb/src/query/mod.rs:496:13
|
496 | 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`
|
496 - return true;
496 + true
|
Check warning on line 485 in grovedb/src/query/mod.rs
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:485:75
|
485 | 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 357 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:353:29
|
353 | / ... if let Some(subquery) = &query.default_subquery_branch.subquery {
354 | | ... Some(SinglePathSubquery::from_query(subquery))
355 | | ... } else {
356 | | ... None
357 | | ... }
| |_______________________^ help: try: `query.default_subquery_branch.subquery.as_ref().map(|subquery| SinglePathSubquery::from_query(subquery))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map
Check warning on line 306 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:302:41
|
302 | / ... if let Some(subquery) = &subquery_branch.subquery {
303 | | ... Some(SinglePathSubquery::from_query(subquery))
304 | | ... } else {
305 | | ... None
306 | | ... }
| |_______________________^ help: try: `subquery_branch.subquery.as_ref().map(|subquery| SinglePathSubquery::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 279 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:279:32
|
279 | pub fn query_items_at_path<'a>(&'a self, path: &[&[u8]]) -> Option<SinglePathSubquery> {
| ^^ ^^ ^^^^^^^^^^^^^^^^^^
|
= 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
|
279 - pub fn query_items_at_path<'a>(&'a self, path: &[&[u8]]) -> Option<SinglePathSubquery> {
279 + pub fn query_items_at_path(&self, path: &[&[u8]]) -> Option<SinglePathSubquery> {
|
Check warning on line 200 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:200:9
|
200 | 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:274:37
|
274 | ... 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 325 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:325:25
|
325 | 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 253 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:253:13
|
253 | 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 36 in grovedb/src/operations/proof/verify.rs
github-actions / clippy
unnecessary operation
warning: unnecessary operation
--> grovedb/src/operations/proof/verify.rs:34:13
|
34 | / query.query.limit.ok_or(Error::NotSupported(
35 | | "limits must be set in verify_query_with_absence_proof".to_string(),
36 | | ))? 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
|
34 ~ query.query.limit.ok_or(Error::NotSupported(
35 + "limits must be set in verify_query_with_absence_proof".to_string(),
36 + ))?;
|
Check warning on line 313 in grovedb/src/operations/proof/util.rs
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
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
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