Skip to content

Commit

Permalink
chore: make clippy happy (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rjected authored Jun 25, 2024
1 parent 80c18f9 commit 378bbae
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/hash_builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ impl HashBuilder {
trace!(target: "trie::hash_builder", ?leaf_node, "pushing leaf node");
trace!(target: "trie::hash_builder", rlp = {
self.rlp_buf.clear();
hex::encode(&leaf_node.rlp(&mut self.rlp_buf))
hex::encode(leaf_node.rlp(&mut self.rlp_buf))
}, "leaf node rlp");

self.rlp_buf.clear();
Expand Down Expand Up @@ -259,7 +259,7 @@ impl HashBuilder {
trace!(target: "trie::hash_builder", ?extension_node, "pushing extension node");
trace!(target: "trie::hash_builder", rlp = {
self.rlp_buf.clear();
hex::encode(&extension_node.rlp(&mut self.rlp_buf))
hex::encode(extension_node.rlp(&mut self.rlp_buf))
}, "extension node rlp");

self.rlp_buf.clear();
Expand Down
2 changes: 1 addition & 1 deletion src/nodes/branch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl Decodable for BranchNode {

impl BranchNode {
/// Creates a new branch node with the given stack and state mask.
pub fn new(stack: Vec<Vec<u8>>, state_mask: TrieMask) -> Self {
pub const fn new(stack: Vec<Vec<u8>>, state_mask: TrieMask) -> Self {
Self { stack, state_mask }
}

Expand Down
2 changes: 1 addition & 1 deletion src/nodes/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl ExtensionNode {
pub const ODD_FLAG: u8 = 0x10;

/// Creates a new extension node with the given key and a pointer to the child.
pub fn new(key: Nibbles, child: Vec<u8>) -> Self {
pub const fn new(key: Nibbles, child: Vec<u8>) -> Self {
Self { key, child }
}

Expand Down
2 changes: 1 addition & 1 deletion src/nodes/leaf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl LeafNode {
pub const ODD_FLAG: u8 = 0x30;

/// Creates a new leaf node with the given key and value.
pub fn new(key: Nibbles, value: Vec<u8>) -> Self {
pub const fn new(key: Nibbles, value: Vec<u8>) -> Self {
Self { key, value }
}

Expand Down

0 comments on commit 378bbae

Please sign in to comment.