Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Commit a4a54b1

Browse files
committed
clippy
1 parent 16ef6b1 commit a4a54b1

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

bus-mapping/src/circuit_input_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ impl<'a> CircuitInputBuilder {
678678
)
679679
} else {
680680
let stack_input_num = 1024 - geth_step.op.valid_stack_ptr_range().1 as usize;
681-
(0..stack_input_num).into_iter().map(|i|
681+
(0..stack_input_num).map(|i|
682682
format!("{:?}", geth_step.stack.nth_last(i))
683683
).collect_vec().join(" ")
684684
}

bus-mapping/src/circuit_input_builder/input_state_ref.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,7 +1346,7 @@ impl<'a> CircuitInputStateRef<'a> {
13461346
) -> Result<(), Error> {
13471347
let call = self.call()?.clone();
13481348
let geth_step = steps
1349-
.get(0)
1349+
.first()
13501350
.ok_or(Error::InternalError("invalid index 0"))?;
13511351
let is_err = exec_step.error.is_some();
13521352
let is_return_revert_succ = (geth_step.op == OpcodeId::REVERT
@@ -1516,7 +1516,7 @@ impl<'a> CircuitInputStateRef<'a> {
15161516

15171517
let call = self.call()?;
15181518

1519-
if matches!(next_step, None) {
1519+
if next_step.is_none() {
15201520
// enumerating call scope successful cases
15211521
// case 1: call with normal halt opcode termination
15221522
if matches!(

bus-mapping/src/circuit_input_builder/l2.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,8 @@ impl CircuitInputBuilder {
395395
!existed
396396
}),
397397
)
398-
.fold(
399-
Ok(HashMap::new()),
398+
.try_fold(
399+
HashMap::new(),
400400
|m, parsed| -> Result<HashMap<_, _>, Error> {
401401
let mut m = m?;
402402
let (addr, acc) = parsed.map_err(Error::IoError)?;
@@ -415,8 +415,8 @@ impl CircuitInputBuilder {
415415
!existed
416416
}),
417417
)
418-
.fold(
419-
Ok(HashMap::new()),
418+
.try_fold(
419+
HashMap::new(),
420420
|m, parsed| -> Result<HashMap<(Address, Word), Word>, Error> {
421421
let mut m = m?;
422422
let ((addr, key), val) = parsed.map_err(Error::IoError)?;

0 commit comments

Comments
 (0)