File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -514,8 +514,7 @@ impl ChiselDispatcher {
514514 let json = response. json :: < EtherscanABIResponse > ( ) . await . unwrap ( ) ;
515515 if json. status == "1" && json. result . is_some ( ) {
516516 let abi = json. result . unwrap ( ) ;
517- let abi: serde_json:: Result < JsonAbi > =
518- serde_json:: from_slice ( abi. as_bytes ( ) ) ;
517+ let abi: serde_json:: Result < JsonAbi > = serde_json:: from_str ( & abi) ;
519518 if let Ok ( abi) = abi {
520519 let mut interface = format ! (
521520 "// Interface of {}\n interface {} {{\n " ,
Original file line number Diff line number Diff line change @@ -43,9 +43,8 @@ pub fn read_to_string(path: impl AsRef<Path>) -> Result<String> {
4343pub fn read_json_file < T : DeserializeOwned > ( path : & Path ) -> Result < T > {
4444 // read the file into a byte array first
4545 // https://github.com/serde-rs/json/issues/160
46- let bytes = read ( path) ?;
47- serde_json:: from_slice ( & bytes)
48- . map_err ( |source| FsPathError :: ReadJson { source, path : path. into ( ) } )
46+ let s = read_to_string ( path) ?;
47+ serde_json:: from_str ( & s) . map_err ( |source| FsPathError :: ReadJson { source, path : path. into ( ) } )
4948}
5049
5150/// Writes the object as a JSON object.
You can’t perform that action at this time.
0 commit comments