Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed issue with query if no path element #354

Merged
merged 1 commit into from
Jan 21, 2025

fix: fixed issue with query if no path element

e3ac3f7
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

fix: fixed issue with query if no path element #354

fix: fixed issue with query if no path element
e3ac3f7
Select commit
Loading
Failed to load commit list.
GitHub Actions / clippy succeeded Jan 20, 2025 in 1s

clippy

105 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 105
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 warning on line 1341 in grovedb/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
    --> grovedb/src/lib.rs:1332:5
     |
1332 | /     fn verify_merk_and_submerks_in_transaction<'db, B: AsRef<[u8]>, S: StorageContext<'db>>(
1333 | |         &'db self,
1334 | |         merk: Merk<S>,
1335 | |         path: &SubtreePath<B>,
...    |
1340 | |         grove_version: &GroveVersion,
1341 | |     ) -> Result<VerificationIssues, Error> {
     | |__________________________________________^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 512 in grovedb/src/query/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
   --> grovedb/src/query/mod.rs:512:6
    |
512 | impl<'a> fmt::Display for SinglePathSubquery<'a> {
    |      ^^                                      ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
512 - impl<'a> fmt::Display for SinglePathSubquery<'a> {
512 + impl fmt::Display for SinglePathSubquery<'_> {
    |

Check warning on line 483 in grovedb/src/query/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

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

Check warning on line 467 in grovedb/src/query/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
   --> grovedb/src/query/mod.rs:467:6
    |
467 | impl<'a> fmt::Display for HasSubquery<'a> {
    |      ^^                               ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
467 - impl<'a> fmt::Display for HasSubquery<'a> {
467 + impl fmt::Display for HasSubquery<'_> {
    |

Check warning on line 374 in grovedb/src/operations/proof/verify.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`

warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
   --> grovedb/src/operations/proof/verify.rs:374:25
    |
374 |                         limit_left.as_mut().map(|limit| *limit -= 1);
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |                         |
    |                         help: try: `if let Some(limit) = limit_left.as_mut() { ... }`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn

Check warning on line 293 in grovedb/src/operations/proof/verify.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`

warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
   --> grovedb/src/operations/proof/verify.rs:293:17
    |
293 |                 limit_left.as_mut().map(|limit| *limit -= 1);
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |                 |
    |                 help: try: `if let Some(limit) = limit_left.as_mut() { ... }`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn
    = note: `#[warn(clippy::option_map_unit_fn)]` on by default

Check warning on line 238 in grovedb/src/operations/proof/verify.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/proof/verify.rs:229:5
    |
229 | /     fn verify_layer_proof<T>(
230 | |         layer_proof: &LayerProof,
231 | |         prove_options: &ProveOptions,
232 | |         query: &PathQuery,
...   |
237 | |         grove_version: &GroveVersion,
238 | |     ) -> Result<CryptoHash, Error>
    | |__________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

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

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/insert/mod.rs:217:5
    |
217 | /     fn add_element_on_transaction<'db, B: AsRef<[u8]>>(
218 | |         &'db self,
219 | |         path: SubtreePath<B>,
220 | |         key: &[u8],
...   |
225 | |         grove_version: &GroveVersion,
226 | |     ) -> CostResult<Merk<PrefixedRocksDbTransactionContext<'db>>, Error> {
    | |________________________________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

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

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/insert/mod.rs:117:5
    |
117 | /     fn insert_on_transaction<'db, 'b, B: AsRef<[u8]>>(
118 | |         &self,
119 | |         path: SubtreePath<'b, B>,
120 | |         key: &[u8],
...   |
125 | |         grove_version: &GroveVersion,
126 | |     ) -> CostResult<(), Error> {
    | |______________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 591 in grovedb/src/operations/get/query.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/get/query.rs:582:5
    |
582 | /     pub fn query_raw(
583 | |         &self,
584 | |         path_query: &PathQuery,
585 | |         allow_cache: bool,
...   |
590 | |         grove_version: &GroveVersion,
591 | |     ) -> CostResult<(QueryResultElements, u16), Error> {
    | |______________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 252 in grovedb/src/operations/get/query.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/get/query.rs:243:5
    |
243 | /     pub fn query(
244 | |         &self,
245 | |         path_query: &PathQuery,
246 | |         allow_cache: bool,
...   |
251 | |         grove_version: &GroveVersion,
252 | |     ) -> CostResult<(QueryResultElements, u16), Error> {
    | |______________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 130 in grovedb/src/operations/get/query.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/get/query.rs:121:5
    |
121 | /     pub fn query_many_raw(
122 | |         &self,
123 | |         path_queries: &[&PathQuery],
124 | |         allow_cache: bool,
...   |
129 | |         grove_version: &GroveVersion,
130 | |     ) -> CostResult<QueryResultElements, Error>
    | |_______________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 686 in grovedb/src/operations/delete/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/delete/mod.rs:670:5
    |
670 | /     fn delete_internal_on_transaction<B: AsRef<[u8]>>(
671 | |         &self,
672 | |         path: SubtreePath<B>,
673 | |         key: &[u8],
...   |
685 | |         grove_version: &GroveVersion,
686 | |     ) -> CostResult<bool, Error> {
    | |________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 647 in grovedb/src/operations/delete/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/delete/mod.rs:631:5
    |
631 | /     fn delete_internal<B: AsRef<[u8]>>(
632 | |         &self,
633 | |         path: SubtreePath<B>,
634 | |         key: &[u8],
...   |
646 | |         grove_version: &GroveVersion,
647 | |     ) -> CostResult<bool, Error> {
    | |________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 519 in grovedb/src/operations/delete/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/delete/mod.rs:510:5
    |
510 | /     pub fn delete_operation_for_delete_internal<B: AsRef<[u8]>>(
511 | |         &self,
512 | |         path: SubtreePath<B>,
513 | |         key: &[u8],
...   |
518 | |         grove_version: &GroveVersion,
519 | |     ) -> CostResult<Option<QualifiedGroveDbOp>, Error> {
    | |______________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 124 in grovedb/src/operations/delete/worst_case.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/delete/worst_case.rs:115:5
    |
115 | /     pub fn worst_case_delete_operation_for_delete<'db, S: Storage<'db>>(
116 | |         path: &KeyInfoPath,
117 | |         key: &KeyInfo,
118 | |         in_parent_tree_type: TreeType,
...   |
123 | |         grove_version: &GroveVersion,
124 | |     ) -> CostResult<QualifiedGroveDbOp, Error> {
    | |______________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 209 in grovedb/src/operations/delete/delete_up_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/delete/delete_up_tree.rs:200:5
    |
200 | /     pub fn add_delete_operations_for_delete_up_tree_while_empty<B: AsRef<[u8]>>(
201 | |         &self,
202 | |         path: SubtreePath<B>,
203 | |         key: &[u8],
...   |
208 | |         grove_version: &GroveVersion,
209 | |     ) -> CostResult<Option<Vec<QualifiedGroveDbOp>>, Error> {
    | |___________________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 177 in grovedb/src/operations/delete/delete_up_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/delete/delete_up_tree.rs:168:5
    |
168 | /     pub fn delete_operations_for_delete_up_tree_while_empty<B: AsRef<[u8]>>(
169 | |         &self,
170 | |         path: SubtreePath<B>,
171 | |         key: &[u8],
...   |
176 | |         grove_version: &GroveVersion,
177 | |     ) -> CostResult<Vec<QualifiedGroveDbOp>, Error> {
    | |___________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 149 in grovedb/src/operations/delete/average_case.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/delete/average_case.rs:140:5
    |
140 | /     pub fn average_case_delete_operation_for_delete<'db, S: Storage<'db>>(
141 | |         path: &KeyInfoPath,
142 | |         key: &KeyInfo,
143 | |         in_parent_tree_type: TreeType,
...   |
148 | |         grove_version: &GroveVersion,
149 | |     ) -> CostResult<QualifiedGroveDbOp, Error> {
    | |______________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 753 in grovedb/src/element/query.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (12/7)

warning: this function has too many arguments (12/7)
   --> grovedb/src/element/query.rs:740:5
    |
740 | /     fn query_item(
741 | |         storage: &RocksDbStorage,
742 | |         item: &QueryItem,
743 | |         results: &mut Vec<QueryResultElement>,
...   |
752 | |         grove_version: &GroveVersion,
753 | |     ) -> CostResult<(), Error> {
    | |______________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 316 in grovedb/src/element/query.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/element/query.rs:307:5
    |
307 | /     pub fn get_query_apply_function(
308 | |         storage: &RocksDbStorage,
309 | |         path: &[&[u8]],
310 | |         sized_query: &SizedQuery,
...   |
315 | |         grove_version: &GroveVersion,
316 | |     ) -> CostResult<(QueryResultElements, u16), Error> {
    | |______________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 177 in grovedb/src/element/query.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
   --> grovedb/src/element/query.rs:177:17
    |
177 | 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
    |
177 - impl<'db, 'ctx, 'a> fmt::Display for PathQueryPushArgs<'db, 'ctx, 'a>
177 + impl<'db, 'ctx> fmt::Display for PathQueryPushArgs<'db, 'ctx, '_>
    |

Check warning on line 502 in grovedb/src/element/helpers.rs

See this annotation in the file changed.

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

Check warning on line 393 in grovedb/src/element/helpers.rs

See this annotation in the file changed.

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

Check warning on line 44 in grovedb/src/element/get.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

accessing first element with `key.as_ref().get(0)`

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