Skip to content

Commit

Permalink
fix: clippy checks
Browse files Browse the repository at this point in the history
  • Loading branch information
borispovod committed Nov 23, 2023
1 parent 03e28ae commit 62f2d0d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/l1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ impl InnerWatcher {

let input = &block
.transactions
.get(0)
.first()
.expect(
"Could not find the L1 attributes deposited transaction in the parent L2 block",
)
Expand Down
6 changes: 3 additions & 3 deletions src/types/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl RawTransaction {
pub fn derive_unsafe_epoch(&self) -> Result<(Epoch, u64)> {
let rlp = Rlp::new(self.0.as_slice());
let tx = rlp.as_val::<DepositedTransaction>()?;
let calldata = Bytes::try_from(tx.data)?;
let calldata = Bytes::from(tx.data);
let attr = AttributesDepositedCall::try_from(calldata)?;
let epoch = Epoch::from(&attr);

Expand Down Expand Up @@ -335,8 +335,8 @@ impl TryFrom<Log> for UserDeposited {
.into_bytes()
.unwrap();

let from = Address::try_from(log.topics[1])?;
let to = Address::try_from(log.topics[2])?;
let from = Address::from(log.topics[1]);
let to = Address::from(log.topics[2]);
let mint = U256::from_big_endian(&opaque_data[0..32]);
let value = U256::from_big_endian(&opaque_data[32..64]);
let gas = u64::from_be_bytes(opaque_data[64..72].try_into()?);
Expand Down
2 changes: 1 addition & 1 deletion src/types/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl TryFrom<Block<Transaction>> for HeadInfo {
fn try_from(block: Block<Transaction>) -> std::result::Result<Self, Self::Error> {
let tx_calldata = block
.transactions
.get(0)
.first()
.ok_or(eyre::eyre!(
"Could not find the L1 attributes deposited transaction"
))?
Expand Down

0 comments on commit 62f2d0d

Please sign in to comment.