Skip to content

feat: big sum trees and count trees #444

feat: big sum trees and count trees

feat: big sum trees and count trees #444

GitHub Actions / clippy failed Jan 8, 2025 in 1s

clippy

3 errors, 57 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 3
Warning 57
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 failure on line 629 in grovedb/src/debugger.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

non-exhaustive patterns: `grovedb_merk::TreeFeatureType::BigSummedMerkNode(_)` and `grovedb_merk::TreeFeatureType::CountedMerkNode(_)` not covered

error[E0004]: non-exhaustive patterns: `grovedb_merk::TreeFeatureType::BigSummedMerkNode(_)` and `grovedb_merk::TreeFeatureType::CountedMerkNode(_)` not covered
   --> grovedb/src/debugger.rs:629:29
    |
629 |         feature_type: match feature_type {
    |                             ^^^^^^^^^^^^ patterns `grovedb_merk::TreeFeatureType::BigSummedMerkNode(_)` and `grovedb_merk::TreeFeatureType::CountedMerkNode(_)` not covered
    |
note: `grovedb_merk::TreeFeatureType` defined here
   --> /home/runner/work/grovedb/grovedb/merk/src/tree/tree_feature_type.rs:24:1
    |
24  | pub enum TreeFeatureType {
    | ^^^^^^^^^^^^^^^^^^^^^^^^
...
30  |     BigSummedMerkNode(i128),
    |     ----------------- not covered
31  |     /// Counted Merk Tree None
32  |     CountedMerkNode(u64),
    |     --------------- not covered
    = note: the matched value is of type `grovedb_merk::TreeFeatureType`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
    |
633 ~             },
634 +             grovedb_merk::TreeFeatureType::BigSummedMerkNode(_) | grovedb_merk::TreeFeatureType::CountedMerkNode(_) => todo!()
    |

Check failure on line 512 in grovedb/src/debugger.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

non-exhaustive patterns: `element::Element::BigSumTree(_, _, _)` and `element::Element::CountTree(_, _, _)` not covered

error[E0004]: non-exhaustive patterns: `element::Element::BigSumTree(_, _, _)` and `element::Element::CountTree(_, _, _)` not covered
   --> grovedb/src/debugger.rs:512:11
    |
512 |     match element {
    |           ^^^^^^^ patterns `element::Element::BigSumTree(_, _, _)` and `element::Element::CountTree(_, _, _)` not covered
    |
note: `element::Element` defined here
   --> grovedb/src/element/mod.rs:110:10
    |
110 | pub enum Element {
    |          ^^^^^^^
...
126 |     BigSumTree(Option<Vec<u8>>, BigSumValue, Option<ElementFlags>),
    |     ---------- not covered
...
129 |     CountTree(Option<Vec<u8>>, CountValue, Option<ElementFlags>),
    |     --------- not covered
    = note: the matched value is of type `element::Element`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
    |
599 ~         },
600 ~         element::Element::BigSumTree(_, _, _) | element::Element::CountTree(_, _, _) => todo!(),
    |

Check failure on line 388 in grovedb/src/debugger.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

non-exhaustive patterns: `grovedb_merk::proofs::Node::KVValueHashFeatureType(_, _, _, grovedb_merk::TreeFeatureType::BigSummedMerkNode(_))` and `grovedb_merk::proofs::Node::KVValueHashFeatureType(_, _, _, grovedb_merk::TreeFeatureType::CountedMerkNode(_))` not covered

error[E0004]: non-exhaustive patterns: `grovedb_merk::proofs::Node::KVValueHashFeatureType(_, _, _, grovedb_merk::TreeFeatureType::BigSummedMerkNode(_))` and `grovedb_merk::proofs::Node::KVValueHashFeatureType(_, _, _, grovedb_merk::TreeFeatureType::CountedMerkNode(_))` not covered
   --> grovedb/src/debugger.rs:388:14
    |
388 |     Ok(match node {
    |              ^^^^ patterns `grovedb_merk::proofs::Node::KVValueHashFeatureType(_, _, _, grovedb_merk::TreeFeatureType::BigSummedMerkNode(_))` and `grovedb_merk::proofs::Node::KVValueHashFeatureType(_, _, _, grovedb_merk::TreeFeatureType::CountedMerkNode(_))` not covered
    |
note: `grovedb_merk::proofs::Node` defined here
   --> /home/runner/work/grovedb/grovedb/merk/src/proofs/mod.rs:61:1
    |
61  | pub enum Node {
    | ^^^^^^^^^^^^^
...
80  |     KVValueHashFeatureType(Vec<u8>, Vec<u8>, CryptoHash, TreeFeatureType),
    |     ---------------------- not covered
    = note: the matched value is of type `grovedb_merk::proofs::Node`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
    |
421 ~         },
422 +         grovedb_merk::proofs::Node::KVValueHashFeatureType(_, _, _, grovedb_merk::TreeFeatureType::BigSummedMerkNode(_)) | grovedb_merk::proofs::Node::KVValueHashFeatureType(_, _, _, grovedb_merk::TreeFeatureType::CountedMerkNode(_)) => todo!()
    |

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

See this annotation in the file changed.

@github-actions github-actions / clippy

elided lifetime has a name

warning: elided lifetime has a name
   --> grovedb/src/operations/insert/mod.rs:371:26
    |
363 |     fn add_element_without_transaction<'db, B: AsRef<[u8]>>(
    |                                        --- lifetime `'db` declared here
...
371 |     ) -> CostResult<Merk<PrefixedRocksDbStorageContext>, Error> {
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this elided lifetime gets resolved as `'db`

Check warning on line 2267 in grovedb/src/batch/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

elided lifetime has a name

warning: elided lifetime has a name
    --> grovedb/src/batch/mod.rs:2267:26
     |
2261 |     pub fn open_batch_merk_at_path<'a, B: AsRef<[u8]>>(
     |                                    -- lifetime `'a` declared here
...
2267 |     ) -> CostResult<Merk<PrefixedRocksDbStorageContext>, Error> {
     |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this elided lifetime gets resolved as `'a`
     |
     = note: `#[warn(elided_named_lifetimes)]` on by default

Check warning on line 16 in grovedb/src/batch/estimated_costs/average_case_costs.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused import: `IsSumTree`

warning: unused import: `IsSumTree`
  --> grovedb/src/batch/estimated_costs/average_case_costs.rs:16:5
   |
16 |     IsSumTree,
   |     ^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

Check warning on line 166 in merk/src/tree/link.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

method `aggregateData` should have a snake case name

warning: method `aggregateData` should have a snake case name
   --> merk/src/tree/link.rs:166:18
    |
166 |     pub const fn aggregateData(&self) -> AggregateData {
    |                  ^^^^^^^^^^^^^ help: convert the identifier to snake case: `aggregate_data`
    |
    = note: `#[warn(non_snake_case)]` on by default

Check warning on line 87 in merk/src/visualize.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
  --> 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> {
   |

Check warning on line 68 in merk/src/visualize.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
  --> 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>
   |

Check warning on line 718 in merk/src/estimated_costs/average_case_costs.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casting to the same type is unnecessary (`u32` -> `u32`)

warning: casting to the same type is unnecessary (`u32` -> `u32`)
   --> merk/src/estimated_costs/average_case_costs.rs:718:24
    |
718 |     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

Check warning on line 450 in merk/src/estimated_costs/average_case_costs.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casting to the same type is unnecessary (`u32` -> `u32`)

warning: casting to the same type is unnecessary (`u32` -> `u32`)
   --> merk/src/estimated_costs/average_case_costs.rs:450:24
    |
450 |     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

Check warning on line 51 in merk/src/estimated_costs/average_case_costs.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

duplicated attribute

warning: duplicated attribute
  --> merk/src/estimated_costs/average_case_costs.rs:51:7
   |
51 | #[cfg(feature = "full")]
   |       ^^^^^^^^^^^^^^^^
   |
note: first defined here
  --> merk/src/estimated_costs/average_case_costs.rs:50:7
   |
50 | #[cfg(feature = "full")]
   |       ^^^^^^^^^^^^^^^^
help: remove this attribute
  --> merk/src/estimated_costs/average_case_costs.rs:51:7
   |
51 | #[cfg(feature = "full")]
   |       ^^^^^^^^^^^^^^^^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes
   = note: `#[warn(clippy::duplicated_attributes)]` on by default

Check warning on line 957 in merk/src/tree/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (9/7)

warning: this function has too many arguments (9/7)
   --> merk/src/tree/mod.rs:930:5
    |
930 | /     pub fn put_value_with_reference_value_hash_and_value_cost(
931 | |         mut self,
932 | |         value: Vec<u8>,
933 | |         value_hash: CryptoHash,
...   |
956 | |         >,
957 | |     ) -> 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 898 in merk/src/tree/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)
   --> merk/src/tree/mod.rs:872:5
    |
872 | /     pub fn put_value_and_reference_value_hash(
873 | |         mut self,
874 | |         value: Vec<u8>,
875 | |         value_hash: CryptoHash,
...   |
897 | |         >,
898 | |     ) -> 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 842 in merk/src/tree/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)
   --> merk/src/tree/mod.rs:816:5
    |
816 | /     pub fn put_value_with_fixed_cost(
817 | |         mut self,
818 | |         value: Vec<u8>,
819 | |         value_fixed_cost: u32,
...   |
841 | |         >,
842 | |     ) -> 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 461 in merk/src/tree/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casting integer literal to `u32` is unnecessary

warning: casting integer literal to `u32` is unnecessary
   --> merk/src/tree/mod.rs:461:49
    |
461 |                     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

Check warning on line 368 in merk/src/tree/walk/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (9/7)

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

Check warning on line 321 in merk/src/tree/walk/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)
   --> 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

Check warning on line 275 in merk/src/tree/walk/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)
   --> 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

Check warning on line 745 in merk/src/tree/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (11/7)

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

Check warning on line 424 in merk/src/tree/ops.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)
   --> 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

Check warning on line 244 in merk/src/tree/ops.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)
   --> 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

Check warning on line 158 in merk/src/tree/ops.rs

See this annotation in the file changed.

@github-actions 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: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

Check warning on line 68 in merk/src/tree/iter.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
  --> 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<'_> {
   |

Check warning on line 705 in merk/src/proofs/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
   --> 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>
    |