Skip to content

Commit d227451

Browse files
committed
clippy
1 parent 00acb04 commit d227451

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

testool/src/statetest/yaml.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,7 @@ mod test {
528528
statetest::{executor::StateTestError, run_test, CircuitsConfig},
529529
};
530530
use eth_types::{address, AccessList, AccessListItem};
531+
use std::fmt::Display;
531532

532533
const TEMPLATE: &str = r#"
533534
arith:
@@ -641,9 +642,9 @@ arith:
641642
}
642643
}
643644
}
644-
impl ToString for Template {
645-
fn to_string(&self) -> String {
646-
TEMPLATE
645+
impl Display for Template {
646+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
647+
let str = TEMPLATE
647648
.replace("{{ gas_limit }}", &self.gas_limit)
648649
.replace("{{ pre_code }}", &self.pre_code)
649650
.replace("{{ res_storage }}", &self.res_storage)
@@ -657,7 +658,8 @@ arith:
657658
} else {
658659
"Istanbul"
659660
},
660-
)
661+
);
662+
write!(f, "{}", str)
661663
}
662664
}
663665

0 commit comments

Comments
 (0)