safety #178
clippy
9 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 9 |
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 1063 in src/lazy_merkle_tree.rs
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
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
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
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 965 in src/lazy_merkle_tree.rs
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 836 in src/lazy_merkle_tree.rs
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:836:41
|
836 | 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 799 in src/lazy_merkle_tree.rs
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:799:9
|
799 | 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 770 in src/lazy_merkle_tree.rs
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:770:9
|
770 | 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
note: the lint level is defined here
--> src/lib.rs:2:9
|
2 | #![warn(clippy::all, clippy::cargo)]
| ^^^^^^^^^^^
= note: `#[warn(clippy::clone_on_copy)]` implied by `#[warn(clippy::all)]`
Check warning on line 24 in src/util.rs
github-actions / clippy
function `as_bytes` is never used
warning: function `as_bytes` is never used
--> src/util.rs:24:22
|
24 | pub(crate) unsafe fn as_bytes<T: ?Sized>(p: &T) -> &[u8] {
| ^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default