feat: db state sync by merk chunking #237
clippy
25 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 25 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.77.2 (25ef9e3d8 2024-04-09)
- cargo 1.77.2 (e52e36006 2024-03-26)
- clippy 0.1.77 (25ef9e3 2024-04-09)
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:63:13
|
63 | / writeln!(
64 | | f,
65 | | " prefix:{:?} -> path:{:?}\n",
66 | | hex::encode(prefix),
67 | | metadata_path_str
68 | | );
| |_____________^
|
= 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 941 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:941:10
|
941 | ) -> 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 871 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:871:10
|
871 | ) -> 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 845 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:845:10
|
845 | ) -> 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 207 in grovedb/src/replication.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'db
warning: the following explicit lifetimes could be elided: 'db
--> grovedb/src/replication.rs:207:24
|
207 | pub fn fetch_chunk<'db>(
| ^^^
208 | &'db self,
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
207 ~ pub fn fetch_chunk(
208 ~ &self,
|
Check warning on line 127 in grovedb/src/replication.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'db
warning: the following explicit lifetimes could be elided: 'db
--> grovedb/src/replication.rs:127:34
|
127 | pub fn get_subtrees_metadata<'db>(
| ^^^
128 | &'db 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
|
127 ~ pub fn get_subtrees_metadata(
128 ~ &self,
|
Check warning on line 498 in grovedb/src/operations/proof/generate.rs
github-actions / clippy
this function has too many arguments (9/7)
warning: this function has too many arguments (9/7)
--> grovedb/src/operations/proof/generate.rs:488:5
|
488 | / fn generate_and_store_merk_proof<'a, S, B>(
489 | | &self,
490 | | path: &SubtreePath<B>,
491 | | subtree: &'a Merk<S>,
... |
497 | | key: &[u8],
498 | | ) -> CostResult<(Option<u16>, Option<u16>), Error>
| |______________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
Check warning on line 181 in grovedb/src/operations/proof/generate.rs
github-actions / clippy
this function has too many arguments (8/7)
warning: this function has too many arguments (8/7)
--> grovedb/src/operations/proof/generate.rs:172:5
|
172 | / fn prove_subqueries(
173 | | &self,
174 | | proofs: &mut Vec<u8>,
175 | | path: Vec<&[u8]>,
... |
180 | | is_verbose: bool,
181 | | ) -> CostResult<(), Error> {
| |______________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
Check warning on line 558 in grovedb/src/element/query.rs
github-actions / clippy
this function has too many arguments (11/7)
warning: this function has too many arguments (11/7)
--> grovedb/src/element/query.rs:546:5
|
546 | / fn query_item(
547 | | storage: &RocksDbStorage,
548 | | item: &QueryItem,
549 | | results: &mut Vec<QueryResultElement>,
... |
557 | | add_element_function: fn(PathQueryPushArgs) -> CostResult<(), Error>,
558 | | ) -> 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
Check warning on line 321 in grovedb/src/element/helpers.rs
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:319:9
|
319 | / let Some(value_cost) = self.get_specialized_cost().ok() else {
320 | | return None;
321 | | };
| |__________^ help: replace it with: `let value_cost = self.get_specialized_cost().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 248 in grovedb/src/element/helpers.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/element/helpers.rs:248:14
|
248 | 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
Check warning on line 12 in grovedb/src/versioning.rs
github-actions / clippy
function `read_proof_version` is never used
warning: function `read_proof_version` is never used
--> grovedb/src/versioning.rs:12:8
|
12 | pub fn read_proof_version(mut bytes: &[u8]) -> Result<u32, Error> {
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
Check warning on line 166 in grovedb/src/replication.rs
github-actions / clippy
unnecessary parentheses around pattern
warning: unnecessary parentheses around pattern
--> grovedb/src/replication.rs:166:35
|
166 | if let Ok((Some((elem_value, elem_value_hash)))) = parent_merk
| ^ ^
|
help: remove these parentheses
|
166 - if let Ok((Some((elem_value, elem_value_hash)))) = parent_merk
166 + if let Ok(Some((elem_value, elem_value_hash))) = parent_merk
|
Check warning on line 147 in grovedb/src/replication.rs
github-actions / clippy
unnecessary parentheses around pattern
warning: unnecessary parentheses around pattern
--> grovedb/src/replication.rs:147:35
|
147 | if let Ok((Some((elem_value, elem_value_hash)))) = parent_merk
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
147 - if let Ok((Some((elem_value, elem_value_hash)))) = parent_merk
147 + if let Ok(Some((elem_value, elem_value_hash))) = parent_merk
|
Check warning on line 75 in merk/src/merk/restore.rs
github-actions / clippy
useless use of `vec!`
warning: useless use of `vec!`
--> merk/src/merk/restore.rs:75:70
|
75 | chunk_id_to_root_hash.insert(traversal_instruction_as_string(&vec![]), expected_root_hash);
| ^^^^^^^ help: you can use a slice directly: `&[]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
= note: `#[warn(clippy::useless_vec)]` on by default
Check warning on line 834 in merk/src/tree/mod.rs
github-actions / clippy
this function has too many arguments (8/7)
warning: this function has too many arguments (8/7)
--> merk/src/tree/mod.rs:811:5
|
811 | / pub fn put_value_with_reference_value_hash_and_value_cost(
812 | | mut self,
813 | | value: Vec<u8>,
814 | | value_hash: CryptoHash,
... |
833 | | >,
834 | | ) -> CostResult<Self, Error> {
| |________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
Check warning on line 367 in merk/src/tree/walk/mod.rs
github-actions / clippy
this function has too many arguments (8/7)
warning: this function has too many arguments (8/7)
--> merk/src/tree/walk/mod.rs:344:5
|
344 | / pub fn put_value_with_reference_value_hash_and_value_cost(
345 | | mut self,
346 | | value: Vec<u8>,
347 | | value_hash: CryptoHash,
... |
366 | | >,
367 | | ) -> CostResult<Self, Error> {
| |________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
Check warning on line 728 in merk/src/tree/ops.rs
github-actions / clippy
this function has too many arguments (9/7)
warning: this function has too many arguments (9/7)
--> merk/src/tree/ops.rs:718:5
|
718 | / fn recurse<K: AsRef<[u8]>, C, V, U, R>(
719 | | self,
720 | | batch: &MerkBatch<K>,
721 | | mid: usize,
... |
727 | | section_removal_bytes: &mut R,
728 | | ) -> CostResult<(Option<Self>, KeyUpdates), Error>
| |______________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
Check warning on line 33 in merk/src/proofs/chunk.rs
github-actions / clippy
module has the same name as its containing module
warning: module has the same name as its containing module
--> merk/src/proofs/chunk.rs:33:1
|
33 | pub mod chunk;
| ^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
= note: `#[warn(clippy::module_inception)]` on by default
Check warning on line 286 in merk/src/merk/apply.rs
github-actions / clippy
this function has too many arguments (8/7)
warning: this function has too many arguments (8/7)
--> merk/src/merk/apply.rs:277:5
|
277 | / pub fn apply_unchecked<KB, KA, C, V, U, R>(
278 | | &mut self,
279 | | batch: &MerkBatch<KB>,
280 | | aux: &AuxMerkBatch<KA>,
... |
285 | | section_removal_bytes: &mut R,
286 | | ) -> CostResult<(), Error>
| |______________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
Check warning on line 199 in merk/src/merk/apply.rs
github-actions / clippy
this function has too many arguments (8/7)
warning: this function has too many arguments (8/7)
--> merk/src/merk/apply.rs:176:5
|
176 | / pub fn apply_with_costs_just_in_time_value_update<KB, KA>(
177 | | &mut self,
178 | | batch: &MerkBatch<KB>,
179 | | aux: &AuxMerkBatch<KA>,
... |
198 | | >,
199 | | ) -> 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
Check warning on line 376 in merk/src/merk/chunks.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
--> merk/src/merk/chunks.rs:376:33
|
376 | fn next_chunk(&mut self) -> Option<Result<(Vec<Op>, Option<String>), 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 387 in merk/src/merk/restore.rs
github-actions / clippy
method `attempt_state_recovery` is never used
warning: method `attempt_state_recovery` is never used
--> merk/src/merk/restore.rs:387:8
|
66 | impl<'db, S: StorageContext<'db>> Restorer<S> {
| --------------------------------------------- method in this implementation
...
387 | fn attempt_state_recovery(&mut self) -> Result<(), Error> {
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
Check warning on line 285 in merk/src/merk/chunks.rs
github-actions / clippy
value assigned to `chunk_byte_length` is never read
warning: value assigned to `chunk_byte_length` is never read
--> merk/src/merk/chunks.rs:285:17
|
285 | let mut chunk_byte_length = 0;
| ^^^^^^^^^^^^^^^^^
|
= help: maybe it is overwritten before being read?
= note: `#[warn(unused_assignments)]` on by default
Check warning on line 31 in merk/src/tree/fuzz_tests.rs
github-actions / clippy
'test' may be misspelled as 'tests'
warning: 'test' may be misspelled as 'tests'
--> merk/src/tree/fuzz_tests.rs:31:8
|
31 | #![cfg(tests)]
| ^^^^^ help: did you mean: `test`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#maybe_misused_cfg
= note: `#[warn(clippy::maybe_misused_cfg)]` on by default