fix: tutorials dependencies were wrong #528
clippy
42 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 42 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.79.0 (129f3b996 2024-06-10)
- cargo 1.79.0 (ffa9cf99a 2024-06-03)
- clippy 0.1.79 (129f3b9 2024-06-10)
Annotations
Check warning on line 577 in grovedb/src/operations/proof/verify.rs
github-actions / clippy
assigning the result of `ToOwned::to_owned()` may be inefficient
warning: assigning the result of `ToOwned::to_owned()` may be inefficient
--> grovedb/src/operations/proof/verify.rs:577:17
|
577 | *current_value_bytes = subquery_path_result_set[0].value.to_owned();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `subquery_path_result_set[0].value.clone_into(current_value_bytes)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
= note: `#[warn(clippy::assigning_clones)]` on by default
Check warning on line 497 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:487:5
|
487 | / fn generate_and_store_merk_proof<'a, S, B>(
488 | | &self,
489 | | path: &SubtreePath<B>,
490 | | subtree: &'a Merk<S>,
... |
496 | | key: &[u8],
497 | | ) -> 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 190 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:181:5
|
181 | / fn prove_subqueries(
182 | | &self,
183 | | proofs: &mut Vec<u8>,
184 | | path: Vec<&[u8]>,
... |
189 | | is_verbose: bool,
190 | | ) -> CostResult<(), Error> {
| |______________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
Check warning on line 524 in grovedb/src/operations/delete/mod.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> grovedb/src/operations/delete/mod.rs:524:25
|
524 | &batch,
| ^^^^^^ help: change this to: `batch`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 272 in grovedb/src/operations/delete/mod.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> grovedb/src/operations/delete/mod.rs:272:13
|
272 | &batch,
| ^^^^^^ help: change this to: `batch`
|
= 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
Check warning on line 71 in grovedb/src/operations/delete/worst_case.rs
github-actions / clippy
casting to the same type is unnecessary (`u16` -> `u16`)
warning: casting to the same type is unnecessary (`u16` -> `u16`)
--> grovedb/src/operations/delete/worst_case.rs:71:46
|
71 | for height in (stop_path_height..(path_len as u16)).rev() {
| ^^^^^^^^^^^^^^^^^ help: try: `path_len`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 76 in grovedb/src/operations/delete/average_case.rs
github-actions / clippy
casting to the same type is unnecessary (`u16` -> `u16`)
warning: casting to the same type is unnecessary (`u16` -> `u16`)
--> grovedb/src/operations/delete/average_case.rs:76:46
|
76 | for height in (stop_path_height..(path_len as u16)).rev() {
| ^^^^^^^^^^^^^^^^^ help: try: `path_len`
|
= 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 548 in grovedb/src/element/query.rs
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:535:5
|
535 | / fn query_item(
536 | | storage: &RocksDbStorage,
537 | | item: &QueryItem,
538 | | results: &mut Vec<QueryResultElement>,
... |
547 | | add_element_function: fn(PathQueryPushArgs) -> CostResult<(), Error>,
548 | | ) -> CostResult<(), Error> {
| |______________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
Check warning on line 147 in grovedb/src/element/query.rs
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:138:5
|
138 | / pub fn get_query_apply_function(
139 | | storage: &RocksDbStorage,
140 | | path: &[&[u8]],
141 | | sized_query: &SizedQuery,
... |
146 | | add_element_function: fn(PathQueryPushArgs) -> CostResult<(), Error>,
147 | | ) -> CostResult<(QueryResultElements, u16), 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 243 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:243:14
|
243 | 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
Check warning on line 1572 in grovedb/src/batch/mod.rs
github-actions / clippy
implicitly performing saturating subtraction
warning: implicitly performing saturating subtraction
--> grovedb/src/batch/mod.rs:1570:13
|
1570 | / if current_level > 0 {
1571 | | current_level -= 1;
1572 | | }
| |_____________^ help: try: `current_level = current_level.saturating_sub(1);`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub
= note: `#[warn(clippy::implicit_saturating_sub)]` on by default
Check warning on line 553 in grovedb/src/batch/mod.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/batch/mod.rs:553:50
|
553 | pub fn verify_consistency_of_operations(ops: &Vec<GroveDbOp>) -> GroveDbOpConsistencyResults {
| ^^^^^^^^^^^^^^^ help: change this to: `&[GroveDbOp]`
|
= 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 179 in grovedb/src/batch/mod.rs
github-actions / clippy
non-canonical implementation of `partial_cmp` on an `Ord` type
warning: non-canonical implementation of `partial_cmp` on an `Ord` type
--> grovedb/src/batch/mod.rs:169:1
|
169 | / impl PartialOrd for Op {
170 | | fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
| | _____________________________________________________________-
171 | || match (self, other) {
172 | || (Op::Delete, Op::Insert { .. }) => Some(Ordering::Less),
173 | || (Op::Delete, Op::Replace { .. }) => Some(Ordering::Less),
... ||
177 | || }
178 | || }
| ||_____- help: change this to: `{ Some(self.cmp(other)) }`
179 | | }
| |__^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl
Check warning on line 118 in grovedb/src/batch/key_info.rs
github-actions / clippy
non-canonical implementation of `partial_cmp` on an `Ord` type
warning: non-canonical implementation of `partial_cmp` on an `Ord` type
--> grovedb/src/batch/key_info.rs:101:1
|
101 | / impl PartialOrd<Self> for KeyInfo {
102 | | fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
| | _____________________________________________________________-
103 | || match self.as_slice().partial_cmp(other.as_slice()) {
104 | || None => None,
105 | || Some(ord) => match ord {
... ||
116 | || }
117 | || }
| ||_____- help: change this to: `{ Some(self.cmp(other)) }`
118 | | }
| |__^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl
= note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default
Check warning on line 242 in grovedb/src/batch/estimated_costs/worst_case_costs.rs
github-actions / clippy
unnecessary use of `get(&base_path).is_none()`
warning: unnecessary use of `get(&base_path).is_none()`
--> grovedb/src/batch/estimated_costs/worst_case_costs.rs:242:34
|
242 | if self.cached_merks.get(&base_path).is_none() {
| ------------------^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: replace it with: `!self.cached_merks.contains(&base_path)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check
Check warning on line 217 in grovedb/src/batch/estimated_costs/worst_case_costs.rs
github-actions / clippy
unnecessary use of `get(path).is_none()`
warning: unnecessary use of `get(path).is_none()`
--> grovedb/src/batch/estimated_costs/worst_case_costs.rs:217:30
|
217 | if self.cached_merks.get(path).is_none() {
| ------------------^^^^^^^^^^^^^^^^^^^
| |
| help: replace it with: `!self.cached_merks.contains(path)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check
Check warning on line 277 in grovedb/src/batch/estimated_costs/average_case_costs.rs
github-actions / clippy
unnecessary use of `get(&base_path).is_none()`
warning: unnecessary use of `get(&base_path).is_none()`
--> grovedb/src/batch/estimated_costs/average_case_costs.rs:277:34
|
277 | if self.cached_merks.get(&base_path).is_none() {
| ------------------^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: replace it with: `!self.cached_merks.contains_key(&base_path)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check
Check warning on line 238 in grovedb/src/batch/estimated_costs/average_case_costs.rs
github-actions / clippy
iterating on a map's keys
warning: iterating on a map's keys
--> grovedb/src/batch/estimated_costs/average_case_costs.rs:235:33
|
235 | let paths = self
| _________________________________^
236 | | .paths
237 | | .iter()
238 | | .map(|(k, _v)| k.0.iter().map(|k| hex::encode(k.as_slice())).join("/"))
| |_______________________________________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map
help: try
|
235 ~ let paths = self
236 + .paths.keys().map(|k| k.0.iter().map(|k| hex::encode(k.as_slice())).join("/"))
|
Check warning on line 231 in grovedb/src/batch/estimated_costs/average_case_costs.rs
github-actions / clippy
unnecessary use of `get(path).is_none()`
warning: unnecessary use of `get(path).is_none()`
--> grovedb/src/batch/estimated_costs/average_case_costs.rs:231:30
|
231 | 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
Check warning on line 216 in grovedb/src/batch/estimated_costs/average_case_costs.rs
github-actions / clippy
iterating on a map's keys
warning: iterating on a map's keys
--> grovedb/src/batch/estimated_costs/average_case_costs.rs:213:29
|
213 | let paths = self
| _____________________________^
214 | | .paths
215 | | .iter()
216 | | .map(|(k, _v)| k.0.iter().map(|k| hex::encode(k.as_slice())).join("/"))
| |___________________________________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map
= note: `#[warn(clippy::iter_kv_map)]` on by default
help: try
|
213 ~ let paths = self
214 + .paths.keys().map(|k| k.0.iter().map(|k| hex::encode(k.as_slice())).join("/"))
|
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> {
| ^^^^^^^^^^^^^^^^^^
Check warning on line 166 in grovedb/src/replication.rs
github-actions / clippy
field `0` is never read
warning: field `0` is never read
--> grovedb/src/replication.rs:166:26
|
166 | pub struct RestorerError(String);
| ------------- ^^^^^^
| |
| field in this struct
|
= note: `RestorerError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
|
166 | pub struct RestorerError(());
| ~~
Check warning on line 46 in grovedb/src/batch/mode.rs
github-actions / clippy
variants `Execute`, `AverageCase`, and `WorstCase` are never constructed
warning: variants `Execute`, `AverageCase`, and `WorstCase` are never constructed
--> grovedb/src/batch/mode.rs:46:5
|
45 | pub enum BatchRunMode {
| ------------ variants in this enum
46 | Execute,
| ^^^^^^^
47 | #[cfg(feature = "estimated_costs")]
48 | AverageCase(HashMap<KeyInfoPath, EstimatedLayerInformation>),
| ^^^^^^^^^^^
49 | #[cfg(feature = "estimated_costs")]
50 | WorstCase(HashMap<KeyInfoPath, WorstCaseLayerInformation>),
| ^^^^^^^^^
|
= note: `BatchRunMode` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
Check warning on line 684 in grovedb/src/batch/mod.rs
github-actions / clippy
method `get_batch_run_mode` is never used
warning: method `get_batch_run_mode` is never used
--> grovedb/src/batch/mod.rs:684:8
|
681 | trait TreeCache<G, SR> {
| --------- method in this trait
...
684 | fn get_batch_run_mode(&self) -> BatchRunMode;
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
Check warning on line 263 in grovedb/src/operations/proof/verify.rs
github-actions / clippy
unused variable: `proof_version`
warning: unused variable: `proof_version`
--> grovedb/src/operations/proof/verify.rs:263:14
|
263 | let (proof_version, proof) = read_and_consume_proof_version(proof)?;
| ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_proof_version`
|
= note: `#[warn(unused_variables)]` on by default