Skip to content

fix/refactor: atomicity and caching #428

fix/refactor: atomicity and caching

fix/refactor: atomicity and caching #428

GitHub Actions / clippy succeeded Dec 27, 2024 in 1s

clippy

130 warnings

Details

Results

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

Versions

  • rustc 1.83.0 (90b35a623 2024-11-26)
  • cargo 1.83.0 (5ffbef321 2024-10-29)
  • clippy 0.1.83 (90b35a6 2024-11-26)

Annotations

Check warning on line 739 in grovedb/src/lib.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/lib.rs:730:5
    |
730 | /     fn verify_merk_and_submerks_in_transaction<'db, B: AsRef<[u8]>, S: StorageContext<'db>>(
731 | |         &'db self,
732 | |         merk: Merk<S>,
733 | |         path: &SubtreePath<B>,
...   |
738 | |         grove_version: &GroveVersion,
739 | |     ) -> Result<HashMap<Vec<Vec<u8>>, (CryptoHash, CryptoHash, CryptoHash)>, Error> {
    | |___________________________________________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 739 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:739:10
    |
739 |     ) -> 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 715 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:715:10
    |
715 |     ) -> 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 47 in grovedb/src/util.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/util.rs:47:6
   |
47 | impl<'a, 'db> AsRef<Transaction<'db>> for TxRef<'a, 'db> {
   |      ^^                                         ^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
   |
47 - impl<'a, 'db> AsRef<Transaction<'db>> for TxRef<'a, 'db> {
47 + impl<'db> AsRef<Transaction<'db>> for TxRef<'_, 'db> {
   |

Check warning on line 49 in grovedb/src/replication.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'db

warning: the following explicit lifetimes could be elided: 'db
  --> grovedb/src/replication.rs:49:6
   |
49 | impl<'db> Default for MultiStateSyncInfo<'db> {
   |      ^^^                                 ^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
   |
49 - impl<'db> Default for MultiStateSyncInfo<'db> {
49 + impl Default for MultiStateSyncInfo<'_> {
   |

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

See this annotation in the file changed.

@github-actions github-actions / clippy

calling `push_str()` using a single-character string literal

warning: calling `push_str()` using a single-character string literal
   --> grovedb/src/reference_path.rs:142:17
    |
142 |                 hx.push_str(")");
    |                 ^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `hx.push(')')`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str

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

See this annotation in the file changed.

@github-actions github-actions / clippy

calling `push_str()` using a single-character string literal

warning: calling `push_str()` using a single-character string literal
   --> grovedb/src/reference_path.rs:140:17
    |
140 |                 hx.push_str("(");
    |                 ^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `hx.push('(')`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
    = note: `#[warn(clippy::single_char_add_str)]` on by default

Check warning on line 512 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:512:6
    |
512 | impl<'a> fmt::Display for SinglePathSubquery<'a> {
    |      ^^                                      ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
512 - impl<'a> fmt::Display for SinglePathSubquery<'a> {
512 + impl fmt::Display for SinglePathSubquery<'_> {
    |

Check warning on line 483 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:483:6
    |
483 | impl<'a> HasSubquery<'a> {
    |      ^^              ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
483 - impl<'a> HasSubquery<'a> {
483 + impl HasSubquery<'_> {
    |

Check warning on line 467 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:467:6
    |
467 | impl<'a> fmt::Display for HasSubquery<'a> {
    |      ^^                               ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
467 - impl<'a> fmt::Display for HasSubquery<'a> {
467 + impl fmt::Display for HasSubquery<'_> {
    |

Check warning on line 366 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:366:25
    |
366 |                         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 292 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:292:17
    |
292 |                 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 237 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:228:5
    |
228 | /     fn verify_layer_proof<T>(
229 | |         layer_proof: &LayerProof,
230 | |         prove_options: &ProveOptions,
231 | |         query: &PathQuery,
...   |
236 | |         grove_version: &GroveVersion,
237 | |     ) -> 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 216 in grovedb/src/operations/proof/generate.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/operations/proof/generate.rs:216:74
    |
216 |             self.open_transactional_merk_at_path(path.as_slice().into(), &tx, None, grove_version)
    |                                                                          ^^^ help: change this to: `tx`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 115 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:104:5
    |
104 | /     fn add_element_on_transaction<'db, 'b, 'c, B: AsRef<[u8]>>(
105 | |         &'db self,
106 | |         path: SubtreePath<'b, B>,
107 | |         key: &[u8],
...   |
114 | |         grove_version: &GroveVersion,
115 | |     ) -> CostResult<MerkHandle<'db, 'c>, Error> {
    | |_______________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 75 in grovedb/src/operations/insert/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/operations/insert/mod.rs:75:41
   |
75 |         let merk_cache = MerkCache::new(&self, tx.as_ref(), grove_version);
   |                                         ^^^^^ help: change this to: `self`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 554 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:545:5
    |
545 | /     pub fn query_raw(
546 | |         &self,
547 | |         path_query: &PathQuery,
548 | |         allow_cache: bool,
...   |
553 | |         grove_version: &GroveVersion,
554 | |     ) -> 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 239 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:230:5
    |
230 | /     pub fn query(
231 | |         &self,
232 | |         path_query: &PathQuery,
233 | |         allow_cache: bool,
...   |
238 | |         grove_version: &GroveVersion,
239 | |     ) -> 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 122 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:113:5
    |
113 | /     pub fn query_many_raw(
114 | |         &self,
115 | |         path_queries: &[&PathQuery],
116 | |         allow_cache: bool,
...   |
121 | |         grove_version: &GroveVersion,
122 | |     ) -> 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 595 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:579:5
    |
579 | /     fn delete_internal<B: AsRef<[u8]>>(
580 | |         &self,
581 | |         path: SubtreePath<B>,
582 | |         key: &[u8],
...   |
594 | |         grove_version: &GroveVersion,
595 | |     ) -> 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 455 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:446:5
    |
446 | /     pub fn delete_operation_for_delete_internal<B: AsRef<[u8]>>(
447 | |         &self,
448 | |         path: SubtreePath<B>,
449 | |         key: &[u8],
...   |
454 | |         grove_version: &GroveVersion,
455 | |     ) -> CostResult<Option<QualifiedGroveDbOp>, Error> {
    | |______________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 128 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:119:5
    |
119 | /     pub fn worst_case_delete_operation_for_delete<'db, S: Storage<'db>>(
120 | |         path: &KeyInfoPath,
121 | |         key: &KeyInfo,
122 | |         parent_tree_is_sum_tree: bool,
...   |
127 | |         grove_version: &GroveVersion,
128 | |     ) -> CostResult<QualifiedGroveDbOp, Error> {
    | |______________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 206 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:197:5
    |
197 | /     pub fn add_delete_operations_for_delete_up_tree_while_empty<B: AsRef<[u8]>>(
198 | |         &self,
199 | |         path: SubtreePath<B>,
200 | |         key: &[u8],
...   |
205 | |         grove_version: &GroveVersion,
206 | |     ) -> CostResult<Option<Vec<QualifiedGroveDbOp>>, Error> {
    | |___________________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 174 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:165:5
    |
165 | /     pub fn delete_operations_for_delete_up_tree_while_empty<B: AsRef<[u8]>>(
166 | |         &self,
167 | |         path: SubtreePath<B>,
168 | |         key: &[u8],
...   |
173 | |         grove_version: &GroveVersion,
174 | |     ) -> CostResult<Vec<QualifiedGroveDbOp>, 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<QualifiedGroveDbOp, Error> {
    | |______________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments