Skip to content

Commit

Permalink
clippy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Wollac committed Dec 11, 2023
1 parent 3e70593 commit b2fcf97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion primitives/src/trie/mpt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ impl MptNode {
fn insert_internal(&mut self, key_nibs: &[u8], value: Vec<u8>) -> Result<bool, Error> {
match &mut self.data {
MptNodeData::Null => {
self.data = MptNodeData::Leaf(to_encoded_path(key_nibs, true), value);
self.data = MptNodeData::Leaf(to_encoded_path(&key_nibs, true), value);

Check failure on line 573 in primitives/src/trie/mpt.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] primitives/src/trie/mpt.rs#L573

error: this expression creates a reference which is immediately dereferenced by the compiler --> primitives/src/trie/mpt.rs:573:63 | 573 | self.data = MptNodeData::Leaf(to_encoded_path(&key_nibs, true), value); | ^^^^^^^^^ help: change this to: `key_nibs` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `-D clippy::needless-borrow` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::needless_borrow)]`
Raw output
primitives/src/trie/mpt.rs:573:63:e:error: this expression creates a reference which is immediately dereferenced by the compiler
   --> primitives/src/trie/mpt.rs:573:63
    |
573 |                 self.data = MptNodeData::Leaf(to_encoded_path(&key_nibs, true), value);
    |                                                               ^^^^^^^^^ help: change this to: `key_nibs`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `-D clippy::needless-borrow` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::needless_borrow)]`


__END__
}
MptNodeData::Branch(children) => {
if let Some((i, tail)) = key_nibs.split_first() {
Expand Down

0 comments on commit b2fcf97

Please sign in to comment.