Skip to content

fix: reference insertion without batch + verify #575

fix: reference insertion without batch + verify

fix: reference insertion without batch + verify #575

GitHub Actions / clippy succeeded Aug 14, 2024 in 1s

clippy

57 warnings

Details

Results

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

Versions

  • rustc 1.80.1 (3f5fd8dd4 2024-08-06)
  • cargo 1.80.1 (376290515 2024-07-16)
  • clippy 0.1.80 (3f5fd8d 2024-08-06)

Annotations

Check warning on line 1110 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:1110:10
     |
1110 |     ) -> 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 972 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:972:10
    |
972 |     ) -> 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 931 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:931:10
    |
931 |     ) -> 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 336 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:336:37
    |
336 |                     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 286 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:286:37
    |
286 |                     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 367 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:367:25
    |
367 |                         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 293 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:293:17
    |
293 |                 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
    = note: `#[warn(clippy::option_map_unit_fn)]` on by default

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

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/proof/verify.rs:229:5
    |
229 | /     fn verify_layer_proof<T>(
230 | |         layer_proof: &LayerProof,
231 | |         prove_options: &ProveOptions,
232 | |         query: &PathQuery,
...   |
237 | |         grove_version: &GroveVersion,
238 | |     ) -> Result<CryptoHash, Error>
    | |__________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 309 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:309:10
    |
309 |     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

Check warning on line 227 in grovedb/src/operations/insert/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/insert/mod.rs:218:5
    |
218 | /     fn add_element_on_transaction<'db, B: AsRef<[u8]>>(
219 | |         &'db self,
220 | |         path: SubtreePath<B>,
221 | |         key: &[u8],
...   |
226 | |         grove_version: &GroveVersion,
227 | |     ) -> CostResult<Merk<PrefixedRocksDbTransactionContext<'db>>, Error> {
    | |________________________________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 127 in grovedb/src/operations/insert/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/insert/mod.rs:118:5
    |
118 | /     fn insert_on_transaction<'db, 'b, B: AsRef<[u8]>>(
119 | |         &self,
120 | |         path: SubtreePath<'b, B>,
121 | |         key: &[u8],
...   |
126 | |         grove_version: &GroveVersion,
127 | |     ) -> CostResult<(), Error> {
    | |______________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 551 in grovedb/src/operations/get/query.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/get/query.rs:542:5
    |
542 | /     pub fn query_raw(
543 | |         &self,
544 | |         path_query: &PathQuery,
545 | |         allow_cache: bool,
...   |
550 | |         grove_version: &GroveVersion,
551 | |     ) -> CostResult<(QueryResultElements, u16), Error> {
    | |______________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 240 in grovedb/src/operations/get/query.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/get/query.rs:231:5
    |
231 | /     pub fn query(
232 | |         &self,
233 | |         path_query: &PathQuery,
234 | |         allow_cache: bool,
...   |
239 | |         grove_version: &GroveVersion,
240 | |     ) -> CostResult<(QueryResultElements, u16), Error> {
    | |______________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 123 in grovedb/src/operations/get/query.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/get/query.rs:114:5
    |
114 | /     pub fn query_many_raw(
115 | |         &self,
116 | |         path_queries: &[&PathQuery],
117 | |         allow_cache: bool,
...   |
122 | |         grove_version: &GroveVersion,
123 | |     ) -> CostResult<QueryResultElements, Error>
    | |_______________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 685 in grovedb/src/operations/delete/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/delete/mod.rs:669:5
    |
669 | /     fn delete_internal_on_transaction<B: AsRef<[u8]>>(
670 | |         &self,
671 | |         path: SubtreePath<B>,
672 | |         key: &[u8],
...   |
684 | |         grove_version: &GroveVersion,
685 | |     ) -> CostResult<bool, Error> {
    | |________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 646 in grovedb/src/operations/delete/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/delete/mod.rs:630:5
    |
630 | /     fn delete_internal<B: AsRef<[u8]>>(
631 | |         &self,
632 | |         path: SubtreePath<B>,
633 | |         key: &[u8],
...   |
645 | |         grove_version: &GroveVersion,
646 | |     ) -> CostResult<bool, Error> {
    | |________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 518 in grovedb/src/operations/delete/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/delete/mod.rs:509:5
    |
509 | /     pub fn delete_operation_for_delete_internal<B: AsRef<[u8]>>(
510 | |         &self,
511 | |         path: SubtreePath<B>,
512 | |         key: &[u8],
...   |
517 | |         grove_version: &GroveVersion,
518 | |     ) -> CostResult<Option<GroveDbOp>, Error> {
    | |_____________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 130 in grovedb/src/operations/delete/worst_case.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/delete/worst_case.rs:121:5
    |
121 | /     pub fn worst_case_delete_operation_for_delete<'db, S: Storage<'db>>(
122 | |         path: &KeyInfoPath,
123 | |         key: &KeyInfo,
124 | |         parent_tree_is_sum_tree: bool,
...   |
129 | |         grove_version: &GroveVersion,
130 | |     ) -> CostResult<GroveDbOp, Error> {
    | |_____________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 208 in grovedb/src/operations/delete/delete_up_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/delete/delete_up_tree.rs:199:5
    |
199 | /     pub fn add_delete_operations_for_delete_up_tree_while_empty<B: AsRef<[u8]>>(
200 | |         &self,
201 | |         path: SubtreePath<B>,
202 | |         key: &[u8],
...   |
207 | |         grove_version: &GroveVersion,
208 | |     ) -> CostResult<Option<Vec<GroveDbOp>>, Error> {
    | |__________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 176 in grovedb/src/operations/delete/delete_up_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/delete/delete_up_tree.rs:167:5
    |
167 | /     pub fn delete_operations_for_delete_up_tree_while_empty<B: AsRef<[u8]>>(
168 | |         &self,
169 | |         path: SubtreePath<B>,
170 | |         key: &[u8],
...   |
175 | |         grove_version: &GroveVersion,
176 | |     ) -> CostResult<Vec<GroveDbOp>, Error> {
    | |__________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 148 in grovedb/src/operations/delete/average_case.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/delete/average_case.rs:139:5
    |
139 | /     pub fn average_case_delete_operation_for_delete<'db, S: Storage<'db>>(
140 | |         path: &KeyInfoPath,
141 | |         key: &KeyInfo,
142 | |         parent_tree_is_sum_tree: bool,
...   |
147 | |         grove_version: &GroveVersion,
148 | |     ) -> CostResult<GroveDbOp, Error> {
    | |_____________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 740 in grovedb/src/element/query.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (12/7)

warning: this function has too many arguments (12/7)
   --> grovedb/src/element/query.rs:727:5
    |
727 | /     fn query_item(
728 | |         storage: &RocksDbStorage,
729 | |         item: &QueryItem,
730 | |         results: &mut Vec<QueryResultElement>,
...   |
739 | |         grove_version: &GroveVersion,
740 | |     ) -> CostResult<(), Error> {
    | |______________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 309 in grovedb/src/element/query.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/element/query.rs:300:5
    |
300 | /     pub fn get_query_apply_function(
301 | |         storage: &RocksDbStorage,
302 | |         path: &[&[u8]],
303 | |         sized_query: &SizedQuery,
...   |
308 | |         grove_version: &GroveVersion,
309 | |     ) -> CostResult<(QueryResultElements, u16), Error> {
    | |______________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 325 in grovedb/src/element/helpers.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `let...else` may be rewritten with the `?` operator

warning: this `let...else` may be rewritten with the `?` operator
   --> grovedb/src/element/helpers.rs:323:9
    |
323 | /         let Some(value_cost) = self.get_specialized_cost(grove_version).ok() else {
324 | |             return None;
325 | |         };
    | |__________^ help: replace it with: `let value_cost = self.get_specialized_cost(grove_version).ok()?;`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
    = note: `#[warn(clippy::question_mark)]` on by default

Check warning on line 240 in grovedb/src/element/helpers.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/element/helpers.rs:240:14
    |
240 |         key: &Vec<u8>,
    |              ^^^^^^^^ help: change this to: `&[u8]`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
    = note: `#[warn(clippy::ptr_arg)]` on by default