Skip to content

Commit

Permalink
chore: clippy (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Feb 26, 2024
1 parent 657f93e commit 5f910e2
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/hash_builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ use super::{
BranchNodeCompact, Nibbles, TrieMask, EMPTY_ROOT_HASH,
};
use crate::HashMap;
use alloc::{collections::BTreeMap, vec::Vec};
use alloy_primitives::{keccak256, Bytes, B256};
use core::cmp;
use tracing::trace;

#[allow(unused_imports)]
use alloc::{collections::BTreeMap, vec::Vec};

mod value;
pub use value::HashBuilderValue;

Expand Down Expand Up @@ -417,9 +419,7 @@ impl HashBuilder {
#[cfg(test)]
mod tests {
use super::*;
use crate::HashMap;
use alloc::collections::BTreeMap;
use alloy_primitives::{b256, hex, keccak256, B256, U256};
use alloy_primitives::{b256, hex, U256};
use alloy_rlp::Encodable;

fn triehash_trie_root<I, K, V>(iter: I) -> B256
Expand Down
4 changes: 3 additions & 1 deletion src/hash_builder/proof_retainer.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use crate::Nibbles;
use alloc::{collections::BTreeMap, vec::Vec};
use alloy_primitives::Bytes;

#[allow(unused_imports)]
use alloc::{collections::BTreeMap, vec::Vec};

/// Proof retainer is used to store proofs during merkle trie construction.
/// It is intended to be used within the [`HashBuilder`](crate::HashBuilder).
#[derive(Debug)]
Expand Down
4 changes: 3 additions & 1 deletion src/hash_builder/value.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use alloc::vec::Vec;
use alloy_primitives::B256;
use core::fmt;

#[allow(unused_imports)]
use alloc::vec::Vec;

/// The current value of the hash builder.
#[derive(Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
clippy::missing_const_for_fn,
rustdoc::all
)]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(not(test), warn(unused_crate_dependencies))] // TODO: https://github.com/proptest-rs/proptest/pull/427
#![allow(unknown_lints, non_local_definitions)]
#![deny(unused_must_use, rust_2018_idioms)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
Expand Down
4 changes: 3 additions & 1 deletion src/nodes/branch.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use super::{super::TrieMask, rlp_node, CHILD_INDEX_RANGE};
use alloc::vec::Vec;
use alloy_primitives::B256;
use alloy_rlp::{BufMut, EMPTY_STRING_CODE};

#[allow(unused_imports)]
use alloc::{collections::BTreeMap, vec::Vec};

/// A Branch node is only a pointer to the stack of nodes and is used to
/// create the RLP encoding of the node using masks which filter from
/// the stack of nodes.
Expand Down
4 changes: 3 additions & 1 deletion src/nodes/extension.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use super::{super::Nibbles, rlp_node};
use alloc::vec::Vec;
use alloy_rlp::{BufMut, Encodable};
use core::fmt;
use smallvec::SmallVec;

#[allow(unused_imports)]
use alloc::{collections::BTreeMap, vec::Vec};

/// An intermediate node that exists solely to compress the trie's paths. It contains a path segment
/// (a shared prefix of keys) and a single child pointer. Essentially, an extension node can be
/// thought of as a shortcut within the trie to reduce its overall depth.
Expand Down
5 changes: 3 additions & 2 deletions src/nodes/leaf.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use super::{super::Nibbles, rlp_node};
use alloc::vec::Vec;
use alloy_rlp::{BufMut, Encodable};
use core::fmt;
use smallvec::SmallVec;

use core::fmt;
#[allow(unused_imports)]
use alloc::vec::Vec;

/// A leaf node represents the endpoint or terminal node in the trie. In other words, a leaf node is
/// where actual values are stored.
Expand Down
4 changes: 3 additions & 1 deletion src/nodes/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
//! Various branch nodes produced by the hash builder.
use alloc::vec::Vec;
use alloy_primitives::{keccak256, B256};
use alloy_rlp::EMPTY_STRING_CODE;
use core::ops::Range;

#[allow(unused_imports)]
use alloc::vec::Vec;

mod branch;
pub use branch::{BranchNode, BranchNodeCompact};

Expand Down

0 comments on commit 5f910e2

Please sign in to comment.