Skip to content

merge main

merge main #141

GitHub Actions / clippy succeeded Mar 12, 2024 in 0s

clippy

45 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 45
Note 0
Help 0

Versions

  • rustc 1.78.0-nightly (b11fbfbf3 2024-02-03)
  • cargo 1.78.0-nightly (7bb7b5395 2024-01-20)
  • clippy 0.1.77 (b11fbfb 2024-02-03)

Annotations

Check warning on line 1122 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait

warning: using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait
    --> src/lazy_merkle_tree.rs:1122:47
     |
1122 |         let initial_vals: Vec<H::Hash> = vec![initial_value.clone(); storage_size];
     |                                               ^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*initial_value`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 1063 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait

warning: using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait
    --> src/lazy_merkle_tree.rs:1063:41
     |
1063 |             return SparseTree::new_leaf(hash.clone());
     |                                         ^^^^^^^^^^^^ help: try dereferencing it: `*hash`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 1026 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait

warning: using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait
    --> src/lazy_merkle_tree.rs:1026:9
     |
1026 |         self.storage[self.root_index].clone()
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.storage[self.root_index]`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 997 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait

warning: using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait
   --> src/lazy_merkle_tree.rs:997:9
    |
997 |         self.storage.lock().expect("lock poisoned")[self.root_index].clone()
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.storage.lock().expect("lock poisoned")[self.root_index]`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 986 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait

warning: using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait
   --> src/lazy_merkle_tree.rs:986:45
    |
986 |         storage[leaf_index_in_dense_tree] = value.clone();
    |                                             ^^^^^^^^^^^^^ help: try dereferencing it: `*value`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 984 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

temporary with significant `Drop` can be early dropped

warning: temporary with significant `Drop` can be early dropped
   --> src/lazy_merkle_tree.rs:984:17
    |
983 |       fn update_with_mutation(&self, index: usize, value: &H::Hash) {
    |  ___________________________________________________________________-
984 | |         let mut storage = self.storage.lock().expect("lock poisoned, terminating");
    | |                 ^^^^^^^
985 | |         let leaf_index_in_dense_tree = index + (self.root_index << self.depth);
986 | |         storage[leaf_index_in_dense_tree] = value.clone();
...   |
993 | |         }
994 | |     }
    | |_____- temporary `storage` is currently being dropped at the end of its contained scope
    |
    = note: this might lead to unnecessary resource contention
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#significant_drop_tightening
help: drop the temporary after the end of its last usage
    |
991 ~             storage[current] = H::hash_node(left, right);
992 +             drop(storage);
    |

Check warning on line 965 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait

warning: using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait
   --> src/lazy_merkle_tree.rs:965:13
    |
965 |             r.storage[leaf_index_in_dense_tree].clone()
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `r.storage[leaf_index_in_dense_tree]`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 948 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

temporary with significant `Drop` can be early dropped

warning: temporary with significant `Drop` can be early dropped
   --> src/lazy_merkle_tree.rs:948:13
    |
947 | /     {
948 | |         let guard = self.storage.lock().expect("lock poisoned, terminating");
    | |             ^^^^^
949 | |         let r = DenseTreeMMapRef {
950 | |             depth:          self.depth,
...   |
955 | |         fun(r)
956 | |     }
    | |_____- temporary `guard` is currently being dropped at the end of its contained scope
    |
    = note: this might lead to unnecessary resource contention
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#significant_drop_tightening
help: merge the temporary construction with its single usage
    |
948 ~         
949 +         let r = self.storage.lock().expect("lock poisoned, terminating").;
    |
help: remove separated single usage
    |
949 -         let r = DenseTreeMMapRef {
950 -             depth:          self.depth,
951 -             root_index:     self.root_index,
952 -             storage:        &guard,
953 -             locked_storage: &self.storage,
954 -         };
949 +         
    |

Check warning on line 826 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait

warning: using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait
   --> src/lazy_merkle_tree.rs:826:41
    |
826 |             return SparseTree::new_leaf(hash.clone());
    |                                         ^^^^^^^^^^^^ help: try dereferencing it: `*hash`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 789 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait

warning: using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait
   --> src/lazy_merkle_tree.rs:789:9
    |
789 |         self.storage[self.root_index].clone()
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.storage[self.root_index]`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 760 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait

warning: using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait
   --> src/lazy_merkle_tree.rs:760:9
    |
760 |         self.storage.lock().unwrap()[self.root_index].clone()
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.storage.lock().unwrap()[self.root_index]`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 749 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait

warning: using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait
   --> src/lazy_merkle_tree.rs:749:45
    |
749 |         storage[leaf_index_in_dense_tree] = value.clone();
    |                                             ^^^^^^^^^^^^^ help: try dereferencing it: `*value`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 747 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

temporary with significant `Drop` can be early dropped

warning: temporary with significant `Drop` can be early dropped
   --> src/lazy_merkle_tree.rs:747:17
    |
746 |       fn update_with_mutation(&self, index: usize, value: &H::Hash) {
    |  ___________________________________________________________________-
747 | |         let mut storage = self.storage.lock().expect("lock poisoned, terminating");
    | |                 ^^^^^^^
748 | |         let leaf_index_in_dense_tree = index + (self.root_index << self.depth);
749 | |         storage[leaf_index_in_dense_tree] = value.clone();
...   |
756 | |         }
757 | |     }
    | |_____- temporary `storage` is currently being dropped at the end of its contained scope
    |
    = note: this might lead to unnecessary resource contention
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#significant_drop_tightening
help: drop the temporary after the end of its last usage
    |
754 ~             storage[current] = H::hash_node(left, right);
755 +             drop(storage);
    |

Check warning on line 728 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait

warning: using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait
   --> src/lazy_merkle_tree.rs:728:13
    |
728 |             r.storage[leaf_index_in_dense_tree].clone()
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `r.storage[leaf_index_in_dense_tree]`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 711 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

temporary with significant `Drop` can be early dropped

warning: temporary with significant `Drop` can be early dropped
   --> src/lazy_merkle_tree.rs:711:13
    |
710 | /     {
711 | |         let guard = self.storage.lock().expect("lock poisoned, terminating");
    | |             ^^^^^
712 | |         let r = DenseTreeRef {
713 | |             depth:          self.depth,
...   |
718 | |         fun(r)
719 | |     }
    | |_____- temporary `guard` is currently being dropped at the end of its contained scope
    |
    = note: this might lead to unnecessary resource contention
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#significant_drop_tightening
    = note: `#[warn(clippy::significant_drop_tightening)]` implied by `#[warn(clippy::nursery)]`
help: merge the temporary construction with its single usage
    |
711 ~         
712 +         let r = self.storage.lock().expect("lock poisoned, terminating").;
    |
help: remove separated single usage
    |
712 -         let r = DenseTreeRef {
713 -             depth:          self.depth,
714 -             root_index:     self.root_index,
715 -             storage:        &guard,
716 -             locked_storage: &self.storage,
717 -         };
712 +         
    |

Check warning on line 693 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait

warning: using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait
   --> src/lazy_merkle_tree.rs:693:32
    |
693 |         let mut storage = vec![empty_leaf.clone(); storage_size];
    |                                ^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*empty_leaf`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 657 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait

warning: using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait
   --> src/lazy_merkle_tree.rs:657:16
    |
657 |             || self.root.clone(),
    |                ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.root`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 652 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait

warning: using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait
   --> src/lazy_merkle_tree.rs:652:9
    |
652 |         self.root.clone()
    |         ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.root`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 626 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait

warning: using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait
   --> src/lazy_merkle_tree.rs:626:35
    |
626 |             return Self::new_leaf(value.clone());
    |                                   ^^^^^^^^^^^^^ help: try dereferencing it: `*value`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 580 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait

warning: using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait
   --> src/lazy_merkle_tree.rs:580:23
    |
580 |             root:     self.root.clone(),
    |                       ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.root`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 563 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant clone

warning: redundant clone
   --> src/lazy_merkle_tree.rs:563:39
    |
563 |             let right = children.right.clone();
    |                                       ^^^^^^^^ help: remove this
    |
note: cloned value is neither consumed nor mutated
   --> src/lazy_merkle_tree.rs:563:25
    |
563 |             let right = children.right.clone();
    |                         ^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone

Check warning on line 562 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant clone

warning: redundant clone
   --> src/lazy_merkle_tree.rs:562:37
    |
562 |             let left = children.left.clone();
    |                                     ^^^^^^^^ help: remove this
    |
note: cloned value is neither consumed nor mutated
   --> src/lazy_merkle_tree.rs:562:24
    |
562 |             let left = children.left.clone();
    |                        ^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
note: the lint level is defined here
   --> src/lib.rs:2:55
    |
2   | #![warn(clippy::all, clippy::pedantic, clippy::cargo, clippy::nursery)]
    |                                                       ^^^^^^^^^^^^^^^
    = note: `#[warn(clippy::redundant_clone)]` implied by `#[warn(clippy::nursery)]`

Check warning on line 516 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait

warning: using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait
   --> src/lazy_merkle_tree.rs:516:9
    |
516 |         self.empty_tree_values[0].clone()
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.empty_tree_values[0]`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 512 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait

warning: using `clone` on type `<H as Hasher>::Hash` which implements the `Copy` trait
   --> src/lazy_merkle_tree.rs:512:9
    |
512 |         self.empty_tree_values[self.depth].clone()
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.empty_tree_values[self.depth]`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 501 in src/lazy_merkle_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `cloned` where `copied` could be used instead

warning: used `cloned` where `copied` could be used instead
   --> src/lazy_merkle_tree.rs:501:14
    |
501 |             .cloned()
    |              ^^^^^^ help: try: `copied`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cloned_instead_of_copied