Skip to content

feat: big sum trees and count trees #446

feat: big sum trees and count trees

feat: big sum trees and count trees #446

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

clippy

3 errors, 59 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 3
Warning 59
Note 0
Help 0

Versions

  • rustc 1.84.0 (9fc6b4312 2025-01-07)
  • cargo 1.84.0 (66221abde 2024-11-19)
  • clippy 0.1.84 (9fc6b43126 2025-01-07)

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(_)`, `grovedb_merk::TreeFeatureType::CountedMerkNode(_)` and `grovedb_merk::TreeFeatureType::CountedSummedMerkNode(_, _)` not covered

error[E0004]: non-exhaustive patterns: `grovedb_merk::TreeFeatureType::BigSummedMerkNode(_)`, `grovedb_merk::TreeFeatureType::CountedMerkNode(_)` and `grovedb_merk::TreeFeatureType::CountedSummedMerkNode(_, _)` not covered
   --> grovedb/src/debugger.rs:629:29
    |
629 |         feature_type: match feature_type {
    |                             ^^^^^^^^^^^^ patterns `grovedb_merk::TreeFeatureType::BigSummedMerkNode(_)`, `grovedb_merk::TreeFeatureType::CountedMerkNode(_)` and `grovedb_merk::TreeFeatureType::CountedSummedMerkNode(_, _)` not covered
    |
note: `grovedb_merk::TreeFeatureType` defined here
   --> /home/runner/work/grovedb/grovedb/merk/src/tree/tree_feature_type.rs:25:1
    |
25  | pub enum TreeFeatureType {
    | ^^^^^^^^^^^^^^^^^^^^^^^^
...
31  |     BigSummedMerkNode(i128),
    |     ----------------- not covered
32  |     /// Counted Merk Tree None
33  |     CountedMerkNode(u64),
    |     --------------- not covered
34  |     /// Counted and summed Merk Tree None
35  |     CountedSummedMerkNode(u64, i64),
    |     --------------------- 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(_) | grovedb_merk::TreeFeatureType::CountedSummedMerkNode(_, _) => 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(_, _, _)`, `element::Element::CountTree(_, _, _)` and `element::Element::CountSumTree(_, _, _, _)` not covered

error[E0004]: non-exhaustive patterns: `element::Element::BigSumTree(_, _, _)`, `element::Element::CountTree(_, _, _)` and `element::Element::CountSumTree(_, _, _, _)` not covered
   --> grovedb/src/debugger.rs:512:11
    |
512 |     match element {
    |           ^^^^^^^ patterns `element::Element::BigSumTree(_, _, _)`, `element::Element::CountTree(_, _, _)` and `element::Element::CountSumTree(_, _, _, _)` not covered
    |
note: `element::Element` defined here
   --> grovedb/src/element/mod.rs:116:10
    |
116 | pub enum Element {
    |          ^^^^^^^
...
132 |     BigSumTree(Option<Vec<u8>>, BigSumValue, Option<ElementFlags>),
    |     ---------- not covered
...
135 |     CountTree(Option<Vec<u8>>, CountValue, Option<ElementFlags>),
    |     --------- not covered
136 |     /// Combines Element::SumTree and Element::CountTree
137 |     CountSumTree(Option<Vec<u8>>, CountValue, SumValue, 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(_, _, _) | element::Element::CountSumTree(_, _, _, _) => 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(_))`, `grovedb_merk::proofs::Node::KVValueHashFeatureType(_, _, _, grovedb_merk::TreeFeatureType::CountedMerkNode(_))` and `grovedb_merk::proofs::Node::KVValueHashFeatureType(_, _, _, grovedb_merk::TreeFeatureType::CountedSummedMerkNode(_, _))` not covered

error[E0004]: non-exhaustive patterns: `grovedb_merk::proofs::Node::KVValueHashFeatureType(_, _, _, grovedb_merk::TreeFeatureType::BigSummedMerkNode(_))`, `grovedb_merk::proofs::Node::KVValueHashFeatureType(_, _, _, grovedb_merk::TreeFeatureType::CountedMerkNode(_))` and `grovedb_merk::proofs::Node::KVValueHashFeatureType(_, _, _, grovedb_merk::TreeFeatureType::CountedSummedMerkNode(_, _))` not covered
   --> grovedb/src/debugger.rs:388:14
    |
388 |     Ok(match node {
    |              ^^^^ patterns `grovedb_merk::proofs::Node::KVValueHashFeatureType(_, _, _, grovedb_merk::TreeFeatureType::BigSummedMerkNode(_))`, `grovedb_merk::proofs::Node::KVValueHashFeatureType(_, _, _, grovedb_merk::TreeFeatureType::CountedMerkNode(_))` and `grovedb_merk::proofs::Node::KVValueHashFeatureType(_, _, _, grovedb_merk::TreeFeatureType::CountedSummedMerkNode(_, _))` 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(_)) | grovedb_merk::proofs::Node::KVValueHashFeatureType(_, _, _, grovedb_merk::TreeFeatureType::CountedSummedMerkNode(_, _)) => 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 2281 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:2281:26
     |
2275 |     pub fn open_batch_merk_at_path<'a, B: AsRef<[u8]>>(
     |                                    -- lifetime `'a` declared here
...
2281 |     ) -> CostResult<Merk<PrefixedRocksDbStorageContext>, Error> {
     |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this elided lifetime gets resolved as `'a`
     |
     = note: `#[warn(elided_named_lifetimes)]` 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 969 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:942:5
    |
942 | /     pub fn put_value_with_reference_value_hash_and_value_cost(
943 | |         mut self,
944 | |         value: Vec<u8>,
945 | |         value_hash: CryptoHash,
...   |
968 | |         >,
969 | |     ) -> 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 910 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:884:5
    |
884 | /     pub fn put_value_and_reference_value_hash(
885 | |         mut self,
886 | |         value: Vec<u8>,
887 | |         value_hash: CryptoHash,
...   |
909 | |         >,
910 | |     ) -> 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 854 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:828:5
    |
828 | /     pub fn put_value_with_fixed_cost(
829 | |         mut self,
830 | |         value: Vec<u8>,
831 | |         value_fixed_cost: u32,
...   |
853 | |         >,
854 | |     ) -> 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>
    |

Check warning on line 162 in merk/src/proofs/query/map.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/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<'_> {
    |

Check warning on line 417 in merk/src/proofs/encoding.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/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<'_> {
    |