Skip to content

Commit

Permalink
fmt & clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
CeciliaZ030 committed Jan 24, 2024
1 parent c751eb9 commit 03d0a7f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion host/src/util/mpt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub fn is_not_included(key: &[u8], proof_nodes: &[MptNode]) -> Result<bool> {
// for valid proofs, the get must not fail
let value = proof_trie
.get(key)
.map_err(|e| Into::<anyhow::Error>::into(e))
.map_err(Into::<anyhow::Error>::into)
.context("invalid trie")?;

Ok(value.is_none())
Expand Down
6 changes: 3 additions & 3 deletions lib/src/builder/execute/ethereum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@ impl TxExecStrategy<EthereumTxEssence> for EthTxExecStrategy {
let trie_key = tx_no.to_rlp();
tx_trie
.insert_rlp(&trie_key, tx)
.map_err(|e| Into::<anyhow::Error>::into(e))
.map_err(Into::<anyhow::Error>::into)
.context("failed to insert transaction")?;
receipt_trie
.insert_rlp(&trie_key, receipt)
.map_err(|e| Into::<anyhow::Error>::into(e))
.map_err(Into::<anyhow::Error>::into)
.context("failed to insert receipt")?;

// update account states
Expand Down Expand Up @@ -225,7 +225,7 @@ impl TxExecStrategy<EthereumTxEssence> for EthTxExecStrategy {
// Add withdrawal to trie
withdrawals_trie
.insert_rlp(&i.to_rlp(), withdrawal)
.map_err(|e| Into::<anyhow::Error>::into(e))
.map_err(Into::<anyhow::Error>::into)
.context("failed to insert withdrawal")?;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/src/builder/execute/optimism.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@ impl TxExecStrategy<OptimismTxEssence> for OpTxExecStrategy {
let trie_key = tx_no.to_rlp();
tx_trie
.insert_rlp(&trie_key, tx)
.map_err(|e| Into::<anyhow::Error>::into(e))
.map_err(Into::<anyhow::Error>::into)
.context("failed to insert transaction")?;
receipt_trie
.insert_rlp(&trie_key, receipt)
.map_err(|e| Into::<anyhow::Error>::into(e))
.map_err(Into::<anyhow::Error>::into)
.context("failed to insert receipt")?;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use alloc::vec::Vec;
use alloc::{vec, vec::Vec};

use hashbrown::HashMap;
use serde::{Deserialize, Serialize};
Expand Down
4 changes: 2 additions & 2 deletions lib/src/optimism/batcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
// limitations under the License.

use alloc::{
collections::{BinaryHeap, VecDeque, BTreeMap},
collections::{BTreeMap, VecDeque},
vec::Vec,
};
use core::cmp::{Ordering, Reverse};
use core::cmp::Ordering;

use anyhow::{bail, ensure, Context, Result};
use zeth_primitives::{
Expand Down
6 changes: 3 additions & 3 deletions lib/src/optimism/batcher_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
// use std::io::Read;

use alloc::{
format,
collections::{BTreeMap, VecDeque},
format, vec,
vec::Vec,
};

Expand Down Expand Up @@ -585,10 +585,10 @@ mod tests {
let mut channel = new_channel();
channel.add_frame(frame_a).unwrap();
assert_eq!(channel.size, 209);
assert_eq!(channel.is_ready(), false);
assert!(!channel.is_ready());
channel.add_frame(frame_b).unwrap();
assert_eq!(channel.size, 420);
assert_eq!(channel.is_ready(), true);
assert!(channel.is_ready());
assert_eq!(channel.decompress().unwrap(), b"Hello World!");
}
}
Expand Down
2 changes: 1 addition & 1 deletion primitives/src/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub use core::{
result::{Result, Result::*},
};

use alloy_primitives::{BlockNumber, Bytes, B256};
use alloy_primitives::{Bytes, B256};
use alloy_rlp::{Decodable, Encodable};
use alloy_rlp_derive::{RlpDecodable, RlpEncodable};
use serde::{Deserialize, Serialize};
Expand Down

0 comments on commit 03d0a7f

Please sign in to comment.