Skip to content

fix/refactor: atomicity and caching #483

fix/refactor: atomicity and caching

fix/refactor: atomicity and caching #483

Triggered via pull request January 21, 2025 11:18
Status Success
Total duration 7m 17s
Artifacts

coverage.yml

on: pull_request
Code Coverage
7m 9s
Code Coverage
Fit to window
Zoom out
Zoom in

Annotations

103 warnings
this function has too many arguments (8/7): grovedb/src/lib.rs#L992
warning: this function has too many arguments (8/7) --> grovedb/src/lib.rs:992:5 | 992 | / fn verify_merk_and_submerks_in_transaction<'db, B: AsRef<[u8]>, S: StorageContext<'db>>( 993 | | &'db self, 994 | | merk: Merk<S>, 995 | | path: &SubtreePath<B>, ... | 1000 | | grove_version: &GroveVersion, 1001 | | ) -> Result<VerificationIssues, Error> { | |__________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
the following explicit lifetimes could be elided: 'b: grovedb/src/lib.rs#L303
warning: the following explicit lifetimes could be elided: 'b --> grovedb/src/lib.rs:303:37 | 303 | fn parent_key_not_found<'b, B: AsRef<[u8]>>( | ^^ 304 | e: Error, 305 | parent_path: SubtreePath<'b, B>, | ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 303 ~ fn parent_key_not_found<B: AsRef<[u8]>>( 304 | e: Error, 305 ~ parent_path: SubtreePath<'_, B>, |
the following explicit lifetimes could be elided: 'b: grovedb/src/util/compat.rs#L91
warning: the following explicit lifetimes could be elided: 'b --> grovedb/src/util/compat.rs:91:33 | 91 | fn parent_key_not_found<'b, B: AsRef<[u8]>>( | ^^ 92 | e: Error, 93 | _parent_path: SubtreePath<'b, B>, | ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 91 ~ fn parent_key_not_found<B: AsRef<[u8]>>( 92 | e: Error, 93 ~ _parent_path: SubtreePath<'_, B>, |
the following explicit lifetimes could be elided: 'b: grovedb/src/util/compat.rs#L13
warning: the following explicit lifetimes could be elided: 'b --> grovedb/src/util/compat.rs:13:29 | 13 | fn parent_key_not_found<'b, B: AsRef<[u8]>>( | ^^ 14 | e: Error, 15 | parent_path: SubtreePath<'b, B>, | ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 13 ~ fn parent_key_not_found<B: AsRef<[u8]>>( 14 | e: Error, 15 ~ parent_path: SubtreePath<'_, B>, |
the following explicit lifetimes could be elided: 'a: grovedb/src/query/mod.rs#L512
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<'_> { |
the following explicit lifetimes could be elided: 'a: grovedb/src/query/mod.rs#L483
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<'_> { |
the following explicit lifetimes could be elided: 'a: grovedb/src/query/mod.rs#L467
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<'_> { |
called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`: grovedb/src/operations/proof/verify.rs#L373
warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` --> grovedb/src/operations/proof/verify.rs:373:25 | 373 | 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
called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`: grovedb/src/operations/proof/verify.rs#L292
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
this function has too many arguments (8/7): grovedb/src/operations/proof/verify.rs#L228
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
this function has too many arguments (8/7): grovedb/src/operations/insert/mod.rs#L169
warning: this function has too many arguments (8/7) --> grovedb/src/operations/insert/mod.rs:169:5 | 169 | / fn add_element_on_transaction<'db, B: AsRef<[u8]>>( 170 | | &'db self, 171 | | path: SubtreePath<B>, 172 | | key: &[u8], ... | 177 | | grove_version: &GroveVersion, 178 | | ) -> CostResult<Merk<PrefixedRocksDbTransactionContext<'db>>, Error> { | |________________________________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): grovedb/src/operations/insert/mod.rs#L113
warning: this function has too many arguments (8/7) --> grovedb/src/operations/insert/mod.rs:113:5 | 113 | / fn insert_on_transaction<'db, 'b, B: AsRef<[u8]>>( 114 | | &self, 115 | | path: SubtreePath<'b, B>, 116 | | key: &[u8], ... | 121 | | grove_version: &GroveVersion, 122 | | ) -> CostResult<(), Error> { | |______________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): grovedb/src/operations/get/query.rs#L580
warning: this function has too many arguments (8/7) --> grovedb/src/operations/get/query.rs:580:5 | 580 | / pub fn query_raw( 581 | | &self, 582 | | path_query: &PathQuery, 583 | | allow_cache: bool, ... | 588 | | grove_version: &GroveVersion, 589 | | ) -> CostResult<(QueryResultElements, u16), Error> { | |______________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): grovedb/src/operations/get/query.rs#L241
warning: this function has too many arguments (8/7) --> grovedb/src/operations/get/query.rs:241:5 | 241 | / pub fn query( 242 | | &self, 243 | | path_query: &PathQuery, 244 | | allow_cache: bool, ... | 249 | | grove_version: &GroveVersion, 250 | | ) -> CostResult<(QueryResultElements, u16), Error> { | |______________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): grovedb/src/operations/get/query.rs#L119
warning: this function has too many arguments (8/7) --> grovedb/src/operations/get/query.rs:119:5 | 119 | / pub fn query_many_raw( 120 | | &self, 121 | | path_queries: &[&PathQuery], 122 | | allow_cache: bool, ... | 127 | | grove_version: &GroveVersion, 128 | | ) -> CostResult<QueryResultElements, Error> | |_______________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): grovedb/src/operations/delete/mod.rs#L590
warning: this function has too many arguments (8/7) --> grovedb/src/operations/delete/mod.rs:590:5 | 590 | / fn delete_internal_on_transaction<B: AsRef<[u8]>>( 591 | | &self, 592 | | path: SubtreePath<B>, 593 | | key: &[u8], ... | 605 | | grove_version: &GroveVersion, 606 | | ) -> CostResult<bool, Error> { | |________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): grovedb/src/operations/delete/mod.rs#L467
warning: this function has too many arguments (8/7) --> grovedb/src/operations/delete/mod.rs:467:5 | 467 | / pub fn delete_operation_for_delete_internal<B: AsRef<[u8]>>( 468 | | &self, 469 | | path: SubtreePath<B>, 470 | | key: &[u8], ... | 475 | | grove_version: &GroveVersion, 476 | | ) -> CostResult<Option<QualifiedGroveDbOp>, Error> { | |______________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): grovedb/src/operations/delete/worst_case.rs#L113
warning: this function has too many arguments (8/7) --> grovedb/src/operations/delete/worst_case.rs:113:5 | 113 | / pub fn worst_case_delete_operation_for_delete<'db, S: Storage<'db>>( 114 | | path: &KeyInfoPath, 115 | | key: &KeyInfo, 116 | | in_parent_tree_type: TreeType, ... | 121 | | grove_version: &GroveVersion, 122 | | ) -> CostResult<QualifiedGroveDbOp, Error> { | |______________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): grovedb/src/operations/delete/delete_up_tree.rs#L198
warning: this function has too many arguments (8/7) --> grovedb/src/operations/delete/delete_up_tree.rs:198:5 | 198 | / pub fn add_delete_operations_for_delete_up_tree_while_empty<B: AsRef<[u8]>>( 199 | | &self, 200 | | path: SubtreePath<B>, 201 | | key: &[u8], ... | 206 | | grove_version: &GroveVersion, 207 | | ) -> CostResult<Option<Vec<QualifiedGroveDbOp>>, Error> { | |___________________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): grovedb/src/operations/delete/delete_up_tree.rs#L166
warning: this function has too many arguments (8/7) --> grovedb/src/operations/delete/delete_up_tree.rs:166:5 | 166 | / pub fn delete_operations_for_delete_up_tree_while_empty<B: AsRef<[u8]>>( 167 | | &self, 168 | | path: SubtreePath<B>, 169 | | key: &[u8], ... | 174 | | grove_version: &GroveVersion, 175 | | ) -> CostResult<Vec<QualifiedGroveDbOp>, Error> { | |___________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): grovedb/src/operations/delete/average_case.rs#L138
warning: this function has too many arguments (8/7) --> grovedb/src/operations/delete/average_case.rs:138:5 | 138 | / pub fn average_case_delete_operation_for_delete<'db, S: Storage<'db>>( 139 | | path: &KeyInfoPath, 140 | | key: &KeyInfo, 141 | | in_parent_tree_type: TreeType, ... | 146 | | grove_version: &GroveVersion, 147 | | ) -> CostResult<QualifiedGroveDbOp, Error> { | |______________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (12/7): grovedb/src/element/query.rs#L713
warning: this function has too many arguments (12/7) --> grovedb/src/element/query.rs:713:5 | 713 | / fn query_item( 714 | | storage: &RocksDbStorage, 715 | | item: &QueryItem, 716 | | results: &mut Vec<QueryResultElement>, ... | 725 | | grove_version: &GroveVersion, 726 | | ) -> CostResult<(), Error> { | |______________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): grovedb/src/element/query.rs#L302
warning: this function has too many arguments (8/7) --> grovedb/src/element/query.rs:302:5 | 302 | / pub fn get_query_apply_function( 303 | | storage: &RocksDbStorage, 304 | | path: &[&[u8]], 305 | | sized_query: &SizedQuery, ... | 310 | | grove_version: &GroveVersion, 311 | | ) -> CostResult<(QueryResultElements, u16), Error> { | |______________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
the following explicit lifetimes could be elided: 'a: grovedb/src/element/query.rs#L172
warning: the following explicit lifetimes could be elided: 'a --> grovedb/src/element/query.rs:172:17 | 172 | impl<'db, 'ctx, 'a> fmt::Display for PathQueryPushArgs<'db, 'ctx, 'a> | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 172 - impl<'db, 'ctx, 'a> fmt::Display for PathQueryPushArgs<'db, 'ctx, 'a> 172 + impl<'db, 'ctx> fmt::Display for PathQueryPushArgs<'db, 'ctx, '_> |
this `let...else` may be rewritten with the `?` operator: grovedb/src/element/helpers.rs#L500
warning: this `let...else` may be rewritten with the `?` operator --> grovedb/src/element/helpers.rs:500:9 | 500 | / let Some(value_cost) = self.get_specialized_cost(grove_version).ok() else { 501 | | return None; 502 | | }; | |__________^ 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
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: grovedb/src/element/helpers.rs#L393
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> grovedb/src/element/helpers.rs:393:14 | 393 | 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
accessing first element with `key.as_ref().get(0)`: grovedb/src/element/get.rs#L44
warning: accessing first element with `key.as_ref().get(0)` --> grovedb/src/element/get.rs:44:49 | 44 | format!("({} in decimal) ", key.as_ref().get(0).unwrap()) | ^^^^^^^^^^^^^^^^^^^ help: try: `key.as_ref().first()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first = note: `#[warn(clippy::get_first)]` on by default
this function has too many arguments (8/7): grovedb/src/batch/mod.rs#L2400
warning: this function has too many arguments (8/7) --> grovedb/src/batch/mod.rs:2400:5 | 2400 | / pub fn apply_partial_batch_with_element_flags_update( 2401 | | &self, 2402 | | ops: Vec<QualifiedGroveDbOp>, 2403 | | batch_apply_options: Option<BatchApplyOptions>, ... | 2422 | | grove_version: &GroveVersion, 2423 | | ) -> CostResult<(), Error> { | |______________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): grovedb/src/batch/mod.rs#L2029
warning: this function has too many arguments (8/7) --> grovedb/src/batch/mod.rs:2029:5 | 2029 | / fn continue_partial_apply_body<'db, S: StorageContext<'db>>( 2030 | | &self, 2031 | | previous_leftover_operations: Option<OpsByLevelPath>, 2032 | | additional_ops: Vec<QualifiedGroveDbOp>, ... | 2048 | | grove_version: &GroveVersion, 2049 | | ) -> CostResult<Option<OpsByLevelPath>, Error> { | |__________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
useless conversion to the same type: `batch::GroveOp`: grovedb/src/batch/mod.rs#L1955
warning: useless conversion to the same type: `batch::GroveOp` --> grovedb/src/batch/mod.rs:1955:37 | 1955 | / ... GroveOp::ReplaceTreeRootKey { 1956 | | ... hash: root_hash, 1957 | | ... root_key: calculated_root_key, 1958 | | ... aggregate_data, 1959 | | ... } 1960 | | ... .into(), | |_____________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion help: consider removing `.into()` | 1955 ~ GroveOp::ReplaceTreeRootKey { 1956 + hash: root_hash, 1957 + root_key: calculated_root_key, 1958 + aggregate_data, 1959 ~ }, |
useless conversion to the same type: `batch::GroveOp`: grovedb/src/batch/mod.rs#L1905
warning: useless conversion to the same type: `batch::GroveOp` --> grovedb/src/batch/mod.rs:1905:61 | 1905 | / ... GroveOp::InsertTreeWithRootHash { 1906 | | ... hash: root_hash, 1907 | | ... root_key: calculated_root_key, 1908 | | ... flags: flags.clone(), 1909 | | ... aggregate_data, 1910 | | ... } 1911 | | ... .into(); | |_____________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion help: consider removing `.into()` | 1905 ~ GroveOp::InsertTreeWithRootHash { 1906 + hash: root_hash, 1907 + root_key: calculated_root_key, 1908 + flags: flags.clone(), 1909 + aggregate_data, 1910 ~ }; |
useless conversion to the same type: `batch::GroveOp`: grovedb/src/batch/mod.rs#L1894
warning: useless conversion to the same type: `batch::GroveOp` --> grovedb/src/batch/mod.rs:1894:61 | 1894 | / ... GroveOp::InsertTreeWithRootHash { 1895 | | ... hash: root_hash, 1896 | | ... root_key: calculated_root_key, 1897 | | ... flags: flags.clone(), 1898 | | ... aggregate_data, 1899 | | ... } 1900 | | ... .into(); | |_____________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion help: consider removing `.into()` | 1894 ~ GroveOp::InsertTreeWithRootHash { 1895 + hash: root_hash, 1896 + root_key: calculated_root_key, 1897 + flags: flags.clone(), 1898 + aggregate_data, 1899 ~ }; |
useless conversion to the same type: `batch::GroveOp`: grovedb/src/batch/mod.rs#L1883
warning: useless conversion to the same type: `batch::GroveOp` --> grovedb/src/batch/mod.rs:1883:61 | 1883 | / ... GroveOp::InsertTreeWithRootHash { 1884 | | ... hash: root_hash, 1885 | | ... root_key: calculated_root_key, 1886 | | ... flags: flags.clone(), 1887 | | ... aggregate_data, 1888 | | ... } 1889 | | ... .into(); | |_____________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion help: consider removing `.into()` | 1883 ~ GroveOp::InsertTreeWithRootHash { 1884 + hash: root_hash, 1885 + root_key: calculated_root_key, 1886 + flags: flags.clone(), 1887 + aggregate_data, 1888 ~ }; |
useless conversion to the same type: `batch::GroveOp`: grovedb/src/batch/mod.rs#L1872
warning: useless conversion to the same type: `batch::GroveOp` --> grovedb/src/batch/mod.rs:1872:61 | 1872 | / ... GroveOp::InsertTreeWithRootHash { 1873 | | ... hash: root_hash, 1874 | | ... root_key: calculated_root_key, 1875 | | ... flags: flags.clone(), 1876 | | ... aggregate_data, 1877 | | ... } 1878 | | ... .into(); | |_____________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion help: consider removing `.into()` | 1872 ~ GroveOp::InsertTreeWithRootHash { 1873 + hash: root_hash, 1874 + root_key: calculated_root_key, 1875 + flags: flags.clone(), 1876 + aggregate_data, 1877 ~ }; |
useless conversion to the same type: `batch::GroveOp`: grovedb/src/batch/mod.rs#L1860
warning: useless conversion to the same type: `batch::GroveOp` --> grovedb/src/batch/mod.rs:1860:61 | 1860 | / ... GroveOp::InsertTreeWithRootHash { 1861 | | ... hash: root_hash, 1862 | | ... root_key: calculated_root_key, 1863 | | ... flags: flags.clone(), ... | 1866 | | ... } 1867 | | ... .into(); | |_____________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion help: consider removing `.into()` | 1860 ~ GroveOp::InsertTreeWithRootHash { 1861 + hash: root_hash, 1862 + root_key: calculated_root_key, 1863 + flags: flags.clone(), 1864 + aggregate_data: 1865 + AggregateData::NoAggregateData, 1866 ~ }; |
useless conversion to the same type: `batch::GroveOp`: grovedb/src/batch/mod.rs#L1828
warning: useless conversion to the same type: `batch::GroveOp` --> grovedb/src/batch/mod.rs:1828:49 | 1828 | / ... GroveOp::ReplaceTreeRootKey { 1829 | | ... hash: root_hash, 1830 | | ... root_key: calculated_root_key, 1831 | | ... aggregate_data, 1832 | | ... } 1833 | | ... .into(), | |_____________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion = note: `#[warn(clippy::useless_conversion)]` on by default help: consider removing `.into()` | 1828 ~ GroveOp::ReplaceTreeRootKey { 1829 + hash: root_hash, 1830 + root_key: calculated_root_key, 1831 + aggregate_data, 1832 ~ }, |
this expression creates a reference which is immediately dereferenced by the compiler: grovedb/src/batch/mod.rs#L1530
warning: this expression creates a reference which is immediately dereferenced by the compiler --> grovedb/src/batch/mod.rs:1530:29 | 1530 | ... &merk, | ^^^^^ help: change this to: `merk` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
returning the result of a `let` binding from a block: grovedb/src/batch/mod.rs#L1719
warning: returning the result of a `let` binding from a block --> grovedb/src/batch/mod.rs:1719:9 | 1714 | / let r = merk 1715 | | .root_hash_key_and_aggregate_data() 1716 | | .add_cost(cost) 1717 | | .map_err(Error::MerkError); | |_______________________________________- unnecessary `let` binding 1718 | 1719 | r | ^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return = note: `#[warn(clippy::let_and_return)]` on by default help: return the expression directly | 1714 ~ 1715 | 1716 ~ merk 1717 + .root_hash_key_and_aggregate_data() 1718 + .add_cost(cost) 1719 + .map_err(Error::MerkError) |
this function has too many arguments (9/7): grovedb/src/batch/mod.rs#L961
warning: this function has too many arguments (9/7) --> grovedb/src/batch/mod.rs:961:5 | 961 | / fn process_reference_with_hop_count_greater_than_one<'a, G, SR>( 962 | | &'a mut self, 963 | | key: &[u8], 964 | | reference_path: &[Vec<u8>], ... | 970 | | grove_version: &GroveVersion, 971 | | ) -> CostResult<CryptoHash, Error> | |______________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
the following explicit lifetimes could be elided: 'a: grovedb/src/batch/mod.rs#L871
warning: the following explicit lifetimes could be elided: 'a --> grovedb/src/batch/mod.rs:871:47 | 871 | fn get_and_deserialize_referenced_element<'a>( | ^^ 872 | &'a mut self, | ^^ | = 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 | 871 ~ fn get_and_deserialize_referenced_element( 872 ~ &mut self, |
this function has too many arguments (8/7): grovedb/src/batch/mod.rs#L743
warning: this function has too many arguments (8/7) --> grovedb/src/batch/mod.rs:743:5 | 743 | / fn process_reference<'a, G, SR>( 744 | | &'a mut self, 745 | | qualified_path: &[Vec<u8>], 746 | | ops_by_qualified_paths: &'a BTreeMap<Vec<Vec<u8>>, GroveOp>, ... | 751 | | grove_version: &GroveVersion, 752 | | ) -> CostResult<CryptoHash, Error> | |______________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
doc list item without indentation: grovedb/src/batch/mod.rs#L730
warning: doc list item without indentation --> grovedb/src/batch/mod.rs:730:9 | 730 | /// missing reference, corrupted data, or invalid batch operation. | ^ | = help: if this is supposed to be its own paragraph, add a blank line = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation help: indent this line | 730 | /// missing reference, corrupted data, or invalid batch operation. | ++
doc list item without indentation: grovedb/src/batch/mod.rs#L726
warning: doc list item without indentation --> grovedb/src/batch/mod.rs:726:9 | 726 | /// associated cost, if successful. | ^ | = help: if this is supposed to be its own paragraph, add a blank line = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation help: indent this line | 726 | /// associated cost, if successful. | ++
doc list item without indentation: grovedb/src/batch/mod.rs#L713
warning: doc list item without indentation --> grovedb/src/batch/mod.rs:713:9 | 713 | /// element. | ^ | = help: if this is supposed to be its own paragraph, add a blank line = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation help: indent this line | 713 | /// element. | +++
doc list item without indentation: grovedb/src/batch/mod.rs#L712
warning: doc list item without indentation --> grovedb/src/batch/mod.rs:712:9 | 712 | /// element and then determines the next step based on the type of the | ^ | = help: if this is supposed to be its own paragraph, add a blank line = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation help: indent this line | 712 | /// element and then determines the next step based on the type of the | +++
doc list item without indentation: grovedb/src/batch/mod.rs#L709
warning: doc list item without indentation --> grovedb/src/batch/mod.rs:709:9 | 709 | /// value hash from the reference element. | ^ | = help: if this is supposed to be its own paragraph, add a blank line = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation = note: `#[warn(clippy::doc_lazy_continuation)]` on by default help: indent this line | 709 | /// value hash from the reference element. | +++
this function has too many arguments (8/7): grovedb/src/batch/mod.rs#L679
warning: this function has too many arguments (8/7) --> grovedb/src/batch/mod.rs:679:5 | 679 | / fn execute_ops_on_path( 680 | | &mut self, 681 | | path: &KeyInfoPath, 682 | | ops_at_path_by_key: BTreeMap<KeyInfo, GroveOp>, ... | 687 | | grove_version: &GroveVersion, 688 | | ) -> CostResult<RootHashKeyAndAggregateData, Error>; | |_______________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this expression creates a reference which is immediately dereferenced by the compiler: grovedb/src/batch/just_in_time_reference_update.rs#L63
warning: this expression creates a reference which is immediately dereferenced by the compiler --> grovedb/src/batch/just_in_time_reference_update.rs:63:47 | 63 | let val_hash = value_hash(&serialized).unwrap_add_cost(&mut cost); | ^^^^^^^^^^^ help: change this to: `serialized` | = 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
this function has too many arguments (9/7): grovedb/src/batch/just_in_time_reference_update.rs#L29
warning: this function has too many arguments (9/7) --> grovedb/src/batch/just_in_time_reference_update.rs:29:5 | 29 | / pub(crate) fn process_old_element_flags<G, SR>( 30 | | key: &[u8], 31 | | serialized: &[u8], 32 | | new_element: &mut Element, ... | 38 | | grove_version: &GroveVersion, 39 | | ) -> CostResult<CryptoHash, Error> | |______________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments = note: `#[warn(clippy::too_many_arguments)]` on by default
usage of `contains_key` followed by `insert` on a `HashMap`: grovedb/src/batch/estimated_costs/average_case_costs.rs#L269
warning: usage of `contains_key` followed by `insert` on a `HashMap` --> grovedb/src/batch/estimated_costs/average_case_costs.rs:269:13 | 269 | / if !self.cached_merks.contains_key(&base_path) { 270 | | cost_return_on_error_no_add!( 271 | | cost, 272 | | GroveDb::add_average_case_get_merk_at_path::<RocksDbStorage>( ... | 283 | | .insert(base_path, estimated_layer_info.tree_type); 284 | | } | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry = note: `#[warn(clippy::map_entry)]` on by default help: try | 269 ~ if let std::collections::hash_map::Entry::Vacant(e) = self.cached_merks.entry(base_path) { 270 + cost_return_on_error_no_add!( 271 + cost, 272 + GroveDb::add_average_case_get_merk_at_path::<RocksDbStorage>( 273 + &mut cost, 274 + &base_path, 275 + estimated_layer_info 276 + .estimated_layer_count 277 + .estimated_to_be_empty(), 278 + estimated_layer_info.tree_type, 279 + grove_version 280 + ) 281 + ); 282 + e.insert(estimated_layer_info.tree_type); 283 + } |
unnecessary use of `get(path).is_none()`: grovedb/src/batch/estimated_costs/average_case_costs.rs#L215
warning: unnecessary use of `get(path).is_none()` --> grovedb/src/batch/estimated_costs/average_case_costs.rs:215:30 | 215 | if self.cached_merks.get(path).is_none() { | ------------------^^^^^^^^^^^^^^^^^^^ | | | help: replace it with: `!self.cached_merks.contains_key(path)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default
function `follow_reference_once` is never used: grovedb/src/reference_path.rs#L637
warning: function `follow_reference_once` is never used --> grovedb/src/reference_path.rs:637:15 | 637 | pub(crate) fn follow_reference_once<'db, 'b, 'c, B: AsRef<[u8]>>( | ^^^^^^^^^^^^^^^^^^^^^
function `follow_reference` is never used: grovedb/src/reference_path.rs#L550
warning: function `follow_reference` is never used --> grovedb/src/reference_path.rs:550:15 | 550 | pub(crate) fn follow_reference<'db, 'b, 'c, B: AsRef<[u8]>>( | ^^^^^^^^^^^^^^^^
struct `ResolvedReference` is never constructed: grovedb/src/reference_path.rs#L541
warning: struct `ResolvedReference` is never constructed --> grovedb/src/reference_path.rs:541:19 | 541 | pub(crate) struct ResolvedReference<'db, 'b, 'c, B> { | ^^^^^^^^^^^^^^^^^
method `invert` is never used: grovedb/src/reference_path.rs#L76
warning: method `invert` is never used --> grovedb/src/reference_path.rs:76:19 | 74 | impl ReferencePathType { | ---------------------- method in this implementation 75 | /// Get an inverted reference 76 | pub(crate) fn invert<B: AsRef<[u8]>>(&self, path: SubtreePath<B>, key: &[u8]) -> Option<Self> { | ^^^^^^
method `for_merk` is never used: grovedb/src/merk_cache.rs#L180
warning: method `for_merk` is never used --> grovedb/src/merk_cache.rs:180:19 | 179 | impl<'db> MerkHandle<'db, '_> { | ----------------------------- method in this implementation 180 | pub(crate) fn for_merk<T>(&mut self, f: impl FnOnce(&mut TxMerk<'db>) -> T) -> T { | ^^^^^^^^
struct `MerkHandle` is never constructed: grovedb/src/merk_cache.rs#L174
warning: struct `MerkHandle` is never constructed --> grovedb/src/merk_cache.rs:174:19 | 174 | pub(crate) struct MerkHandle<'db, 'c> { | ^^^^^^^^^^
associated items `new`, `get_merk`, `into_batch`, and `propagate_subtrees` are never used: grovedb/src/merk_cache.rs#L33
warning: associated items `new`, `get_merk`, `into_batch`, and `propagate_subtrees` are never used --> grovedb/src/merk_cache.rs:33:19 | 31 | impl<'db, 'b, B: AsRef<[u8]>> MerkCache<'db, 'b, B> { | --------------------------------------------------- associated items in this implementation 32 | /// Initialize a new `MerkCache` instance 33 | pub(crate) fn new( | ^^^ ... 48 | pub(crate) fn get_merk<'c>( | ^^^^^^^^ ... 129 | pub(crate) fn into_batch(mut self) -> CostResult<Box<StorageBatch>, Error> { | ^^^^^^^^^^ ... 139 | fn propagate_subtrees(&mut self) -> CostResult<(), Error> { | ^^^^^^^^^^^^^^^^^^
struct `MerkCache` is never constructed: grovedb/src/merk_cache.rs#L23
warning: struct `MerkCache` is never constructed --> grovedb/src/merk_cache.rs:23:19 | 23 | pub(crate) struct MerkCache<'db, 'b, B: AsRef<[u8]>> { | ^^^^^^^^^
type alias `CachedMerkEntry` is never used: grovedb/src/merk_cache.rs#L20
warning: type alias `CachedMerkEntry` is never used --> grovedb/src/merk_cache.rs:20:6 | 20 | type CachedMerkEntry<'db> = Box<(Cell<bool>, TxMerk<'db>)>; | ^^^^^^^^^^^^^^^
type alias `TxMerk` is never used: grovedb/src/merk_cache.rs#L16
warning: type alias `TxMerk` is never used --> grovedb/src/merk_cache.rs:16:6 | 16 | type TxMerk<'db> = Merk<PrefixedRocksDbTransactionContext<'db>>; | ^^^^^^
variants `Execute`, `AverageCase`, and `WorstCase` are never constructed: grovedb/src/batch/mode.rs#L18
warning: variants `Execute`, `AverageCase`, and `WorstCase` are never constructed --> grovedb/src/batch/mode.rs:18:5 | 17 | pub enum BatchRunMode { | ------------ variants in this enum 18 | Execute, | ^^^^^^^ 19 | #[cfg(feature = "estimated_costs")] 20 | AverageCase(HashMap<KeyInfoPath, EstimatedLayerInformation>), | ^^^^^^^^^^^ 21 | #[cfg(feature = "estimated_costs")] 22 | WorstCase(HashMap<KeyInfoPath, WorstCaseLayerInformation>), | ^^^^^^^^^ | = note: `BatchRunMode` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
method `get_batch_run_mode` is never used: grovedb/src/batch/mod.rs#L676
warning: method `get_batch_run_mode` is never used --> grovedb/src/batch/mod.rs:676:8 | 673 | trait TreeCache<G, SR> { | --------- method in this trait ... 676 | fn get_batch_run_mode(&self) -> BatchRunMode; | ^^^^^^^^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default
unexpected `cfg` condition value: `test_utils`: grovedb/src/element/insert.rs#L481
warning: unexpected `cfg` condition value: `test_utils` --> grovedb/src/element/insert.rs:481:32 | 481 | #[cfg(all(feature = "minimal", feature = "test_utils"))] | ^^^^^^^^^^^^^^^^^^^^^^ | = note: expected values for `feature` are: `axum`, `default`, `estimated_costs`, `full`, `grovedb-costs`, `grovedb-merk`, `grovedb-storage`, `grovedb-visualize`, `grovedbg`, `grovedbg-types`, `integer-encoding`, `intmap`, `itertools`, `minimal`, `proof_debug`, `serde`, `tempfile`, `thiserror`, `tokio`, `tokio-util`, `tower-http`, `verify`, `visualize`, and `zip-extensions` = help: consider adding `test_utils` as a feature in `Cargo.toml` = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration = note: `#[warn(unexpected_cfgs)]` on by default
unused imports: `CostsExt` and `OperationCost`: grovedb/src/element/exists.rs#L4
warning: unused imports: `CostsExt` and `OperationCost` --> grovedb/src/element/exists.rs:4:33 | 4 | use grovedb_costs::{CostResult, CostsExt, OperationCost}; | ^^^^^^^^ ^^^^^^^^^^^^^
unused import: `grovedb_costs::OperationCost`: grovedb/src/element/delete.rs#L5
warning: unused import: `grovedb_costs::OperationCost` --> grovedb/src/element/delete.rs:5:5 | 5 | use grovedb_costs::OperationCost; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
the following explicit lifetimes could be elided: 'a: merk/src/visualize.rs#L87
warning: the following explicit lifetimes could be elided: 'a --> merk/src/visualize.rs:87:6 | 87 | impl<'a, T: Visualize, F: Fn(&[u8]) -> T + Copy> Visualize for VisualizableTree<'a, F> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 87 - impl<'a, T: Visualize, F: Fn(&[u8]) -> T + Copy> Visualize for VisualizableTree<'a, F> { 87 + impl<T: Visualize, F: Fn(&[u8]) -> T + Copy> Visualize for VisualizableTree<'_, F> { |
the following explicit lifetimes could be elided: 'a: merk/src/visualize.rs#L68
warning: the following explicit lifetimes could be elided: 'a --> merk/src/visualize.rs:68:6 | 68 | impl<'a, 'db, S: StorageContext<'db>, T: Visualize, F: Fn(&[u8]) -> T + Copy> Visualize | ^^ 69 | for VisualizeableMerk<'a, S, F> | ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 68 ~ impl<'db, S: StorageContext<'db>, T: Visualize, F: Fn(&[u8]) -> T + Copy> Visualize 69 ~ for VisualizeableMerk<'_, S, F> |
casting to the same type is unnecessary (`u32` -> `u32`): merk/src/estimated_costs/average_case_costs.rs#L797
warning: casting to the same type is unnecessary (`u32` -> `u32`) --> merk/src/estimated_costs/average_case_costs.rs:797:24 | 797 | cost.seek_count += nodes_updated as u32; | ^^^^^^^^^^^^^^^^^^^^ help: try: `nodes_updated` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
casting to the same type is unnecessary (`u32` -> `u32`): merk/src/estimated_costs/average_case_costs.rs#L526
warning: casting to the same type is unnecessary (`u32` -> `u32`) --> merk/src/estimated_costs/average_case_costs.rs:526:24 | 526 | cost.seek_count += nodes_updated as u32; | ^^^^^^^^^^^^^^^^^^^^ help: try: `nodes_updated` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
this function has too many arguments (9/7): merk/src/tree/mod.rs#L943
warning: this function has too many arguments (9/7) --> merk/src/tree/mod.rs:943:5 | 943 | / pub fn put_value_with_reference_value_hash_and_value_cost( 944 | | mut self, 945 | | value: Vec<u8>, 946 | | value_hash: CryptoHash, ... | 969 | | >, 970 | | ) -> CostResult<Self, Error> { | |________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): merk/src/tree/mod.rs#L885
warning: this function has too many arguments (8/7) --> merk/src/tree/mod.rs:885:5 | 885 | / pub fn put_value_and_reference_value_hash( 886 | | mut self, 887 | | value: Vec<u8>, 888 | | value_hash: CryptoHash, ... | 910 | | >, 911 | | ) -> CostResult<Self, Error> { | |________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): merk/src/tree/mod.rs#L829
warning: this function has too many arguments (8/7) --> merk/src/tree/mod.rs:829:5 | 829 | / pub fn put_value_with_fixed_cost( 830 | | mut self, 831 | | value: Vec<u8>, 832 | | value_fixed_cost: u32, ... | 854 | | >, 855 | | ) -> CostResult<Self, Error> { | |________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
casting integer literal to `u32` is unnecessary: merk/src/tree/mod.rs#L462
warning: casting integer literal to `u32` is unnecessary --> merk/src/tree/mod.rs:462:49 | 462 | AggregateData::BigSum(_) => 16 as u32, | ^^^^^^^^^ help: try: `16_u32` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast = note: `#[warn(clippy::unnecessary_cast)]` on by default
this function has too many arguments (9/7): merk/src/tree/walk/mod.rs#L341
warning: this function has too many arguments (9/7) --> merk/src/tree/walk/mod.rs:341:5 | 341 | / pub fn put_value_with_reference_value_hash_and_value_cost( 342 | | mut self, 343 | | value: Vec<u8>, 344 | | value_hash: CryptoHash, ... | 367 | | >, 368 | | ) -> CostResult<Self, Error> { | |________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): merk/src/tree/walk/mod.rs#L295
warning: this function has too many arguments (8/7) --> merk/src/tree/walk/mod.rs:295:5 | 295 | / pub fn put_value_and_reference_value_hash( 296 | | mut self, 297 | | value: Vec<u8>, 298 | | value_hash: CryptoHash, ... | 320 | | >, 321 | | ) -> CostResult<Self, Error> { | |________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): merk/src/tree/walk/mod.rs#L249
warning: this function has too many arguments (8/7) --> merk/src/tree/walk/mod.rs:249:5 | 249 | / pub fn put_value_with_fixed_cost( 250 | | mut self, 251 | | value: Vec<u8>, 252 | | value_fixed_cost: u32, ... | 274 | | >, 275 | | ) -> CostResult<Self, Error> { | |________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (11/7): merk/src/tree/ops.rs#L733
warning: this function has too many arguments (11/7) --> merk/src/tree/ops.rs:733:5 | 733 | / fn recurse<K: AsRef<[u8]>, C, V, T, U, R>( 734 | | self, 735 | | batch: &MerkBatch<K>, 736 | | mid: usize, ... | 744 | | grove_version: &GroveVersion, 745 | | ) -> CostResult<(Option<Self>, KeyUpdates), Error> | |______________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): merk/src/tree/ops.rs#L415
warning: this function has too many arguments (8/7) --> merk/src/tree/ops.rs:415:5 | 415 | / fn apply_sorted<K: AsRef<[u8]>, C, V, T, U, R>( 416 | | self, 417 | | batch: &MerkBatch<K>, 418 | | old_specialized_cost: &C, ... | 423 | | grove_version: &GroveVersion, 424 | | ) -> CostResult<(Option<Self>, KeyUpdates), Error> | |______________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): merk/src/tree/ops.rs#L235
warning: this function has too many arguments (8/7) --> merk/src/tree/ops.rs:235:5 | 235 | / fn build<K: AsRef<[u8]>, C, V, T, U, R>( 236 | | batch: &MerkBatch<K>, 237 | | source: S, 238 | | old_tree_cost: &C, ... | 243 | | grove_version: &GroveVersion, 244 | | ) -> CostResult<Option<TreeNode>, Error> | |____________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (9/7): merk/src/tree/ops.rs#L148
warning: this function has too many arguments (9/7) --> merk/src/tree/ops.rs:148:5 | 148 | / pub fn apply_to<K: AsRef<[u8]>, C, V, T, U, R>( 149 | | maybe_tree: Option<Self>, 150 | | batch: &MerkBatch<K>, 151 | | source: S, ... | 157 | | grove_version: &GroveVersion, 158 | | ) -> CostContext<Result<(Option<TreeNode>, KeyUpdates), Error>> | |___________________________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
the following explicit lifetimes could be elided: 'a: merk/src/tree/iter.rs#L68
warning: the following explicit lifetimes could be elided: 'a --> merk/src/tree/iter.rs:68:6 | 68 | impl<'a> Iterator for Iter<'a> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 68 - impl<'a> Iterator for Iter<'a> { 68 + impl Iterator for Iter<'_> { |
this expression creates a reference which is immediately dereferenced by the compiler: merk/src/test_utils/mod.rs#L344
warning: this expression creates a reference which is immediately dereferenced by the compiler --> merk/src/test_utils/mod.rs:344:76 | 344 | .get_transactional_storage_context(SubtreePath::empty(), None, &transaction) | ^^^^^^^^^^^^ help: change this to: `transaction` | = 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
the following explicit lifetimes could be elided: 'a: merk/src/proofs/query/mod.rs#L705
warning: the following explicit lifetimes could be elided: 'a --> merk/src/proofs/query/mod.rs:705:6 | 705 | impl<'a, S> RefWalker<'a, S> | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 705 - impl<'a, S> RefWalker<'a, S> 705 + impl<S> RefWalker<'_, S> |
the following explicit lifetimes could be elided: 'a: merk/src/proofs/query/map.rs#L162
warning: the following explicit lifetimes could be elided: 'a --> merk/src/proofs/query/map.rs:162:6 | 162 | impl<'a> Range<'a> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 162 - impl<'a> Range<'a> { 162 + impl Range<'_> { |
the following explicit lifetimes could be elided: 'a: merk/src/proofs/encoding.rs#L417
warning: the following explicit lifetimes could be elided: 'a --> merk/src/proofs/encoding.rs:417:6 | 417 | impl<'a> Iterator for Decoder<'a> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 417 - impl<'a> Iterator for Decoder<'a> { 417 + impl Iterator for Decoder<'_> { |
the following explicit lifetimes could be elided: 'a: merk/src/proofs/chunk/chunk.rs#L43
warning: the following explicit lifetimes could be elided: 'a --> merk/src/proofs/chunk/chunk.rs:43:6 | 43 | impl<'a, S> RefWalker<'a, S> | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 43 - impl<'a, S> RefWalker<'a, S> 43 + impl<S> RefWalker<'_, S> |
very complex type used. Consider factoring parts into `type` definitions: merk/src/merk/mod.rs#L630
warning: very complex type used. Consider factoring parts into `type` definitions --> merk/src/merk/mod.rs:630:10 | 630 | ) -> (BTreeMap<Vec<u8>, CryptoHash>, BTreeMap<Vec<u8>, Vec<u8>>) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
the following explicit lifetimes could be elided: 'a: merk/src/merk/mod.rs#L190
warning: the following explicit lifetimes could be elided: 'a --> merk/src/merk/mod.rs:190:6 | 190 | impl<'a, I: RawIterator> KVIterator<'a, I> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 190 - impl<'a, I: RawIterator> KVIterator<'a, I> { 190 + impl<I: RawIterator> KVIterator<'_, I> { |
this function has too many arguments (10/7): merk/src/merk/apply.rs#L322
warning: this function has too many arguments (10/7) --> merk/src/merk/apply.rs:322:5 | 322 | / pub fn apply_unchecked<KB, KA, C, V, T, U, R>( 323 | | &mut self, 324 | | batch: &MerkBatch<KB>, 325 | | aux: &AuxMerkBatch<KA>, ... | 332 | | grove_version: &GroveVersion, 333 | | ) -> CostResult<(), Error> | |______________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (10/7): merk/src/merk/apply.rs#L206
warning: this function has too many arguments (10/7) --> merk/src/merk/apply.rs:206:5 | 206 | / pub fn apply_with_costs_just_in_time_value_update<KB, KA>( 207 | | &mut self, 208 | | batch: &MerkBatch<KB>, 209 | | aux: &AuxMerkBatch<KA>, ... | 235 | | grove_version: &GroveVersion, 236 | | ) -> CostResult<(), Error> | |______________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments = note: `#[warn(clippy::too_many_arguments)]` on by default
very complex type used. Consider factoring parts into `type` definitions: merk/src/merk/chunks.rs#L393
warning: very complex type used. Consider factoring parts into `type` definitions --> merk/src/merk/chunks.rs:393:10 | 393 | ) -> Option<Result<(Vec<Op>, Option<Vec<u8>>), Error>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
very complex type used. Consider factoring parts into `type` definitions: merk/src/merk/chunks.rs#L363
warning: very complex type used. Consider factoring parts into `type` definitions --> merk/src/merk/chunks.rs:363:10 | 363 | ) -> Option<Result<(Vec<Op>, Option<Vec<u8>>), 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
method `apply_sorted_without_costs` is never used: merk/src/tree/ops.rs#L390
warning: method `apply_sorted_without_costs` is never used --> merk/src/tree/ops.rs:390:19 | 139 | / impl<S> Walker<S> 140 | | where 141 | | S: Fetch + Sized + Clone, | |_____________________________- method in this implementation ... 390 | pub(crate) fn apply_sorted_without_costs<K: AsRef<[u8]>>( | ^^^^^^^^^^^^^^^^^^^^^^^^^^
method `attempt_state_recovery` is never used: merk/src/merk/restore.rs#L418
warning: method `attempt_state_recovery` is never used --> merk/src/merk/restore.rs:418:8 | 68 | impl<'db, S: StorageContext<'db>> Restorer<S> { | --------------------------------------------- method in this implementation ... 418 | fn attempt_state_recovery(&mut self, grove_version: &GroveVersion) -> Result<(), Error> { | ^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default
unexpected `cfg` condition name: `tests`: merk/src/tree/fuzz_tests.rs#L3
warning: unexpected `cfg` condition name: `tests` --> merk/src/tree/fuzz_tests.rs:3:8 | 3 | #![cfg(tests)] | ^^^^^ help: there is a config with a similar name: `test` | = help: consider using a Cargo feature instead = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint: [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tests)'] } = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(tests)");` to the top of the `build.rs` = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration = note: `#[warn(unexpected_cfgs)]` on by default
elided lifetime has a name: merk/src/proofs/query/map.rs#L110
warning: elided lifetime has a name --> merk/src/proofs/query/map.rs:110:72 | 110 | pub fn range<'a, R: RangeBounds<&'a [u8]>>(&'a self, bounds: R) -> Range { | -- lifetime `'a` declared here ^^^^^ this elided lifetime gets resolved as `'a` | = note: `#[warn(elided_named_lifetimes)]` on by default
using `map` over `inspect`: storage/src/rocksdb_storage/storage_context/raw_iterator.rs#L214
warning: using `map` over `inspect` --> storage/src/rocksdb_storage/storage_context/raw_iterator.rs:214:39 | 214 | self.raw_iterator.value().map(|v| { | ^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect help: try | 214 ~ self.raw_iterator.value().inspect(|v| { 215 ~ cost.storage_loaded_bytes += v.len() as u64; |
using `map` over `inspect`: storage/src/rocksdb_storage/storage_context/raw_iterator.rs#L93
warning: using `map` over `inspect` --> storage/src/rocksdb_storage/storage_context/raw_iterator.rs:93:39 | 93 | self.raw_iterator.value().map(|v| { | ^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect = note: `#[warn(clippy::manual_inspect)]` on by default help: try | 93 ~ self.raw_iterator.value().inspect(|v| { 94 ~ cost.storage_loaded_bytes += v.len() as u64; |
using `clone` on type `CompactBytesIter<'_>` which implements the `Copy` trait: path/src/subtree_path_iter.rs#L155
warning: using `clone` on type `CompactBytesIter<'_>` which implements the `Copy` trait --> path/src/subtree_path_iter.rs:155:89 | 155 | CurrentSubtreePathIter::OwnedBytes(x) => CurrentSubtreePathIter::OwnedBytes(x.clone()), | ^^^^^^^^^ help: try dereferencing it: `*x` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy = note: `#[warn(clippy::clone_on_copy)]` on by default
the following explicit lifetimes could be elided: 'b: path/src/subtree_path_iter.rs#L150
warning: the following explicit lifetimes could be elided: 'b --> path/src/subtree_path_iter.rs:150:6 | 150 | impl<'b, B> Clone for CurrentSubtreePathIter<'b, B> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 150 - impl<'b, B> Clone for CurrentSubtreePathIter<'b, B> { 150 + impl<B> Clone for CurrentSubtreePathIter<'_, B> { |
the following explicit lifetimes could be elided: 'b: path/src/subtree_path_iter.rs#L45
warning: the following explicit lifetimes could be elided: 'b --> path/src/subtree_path_iter.rs:45:6 | 45 | impl<'b, B> Clone for SubtreePathIter<'b, B> { | ^^ ^^ | = 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 | 45 - impl<'b, B> Clone for SubtreePathIter<'b, B> { 45 + impl<B> Clone for SubtreePathIter<'_, B> { |
Code Coverage
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636