Skip to content

Commit

Permalink
Remove map_err in favor of macro implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
fnando committed Jun 6, 2024
1 parent 8506896 commit faac4af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmd/soroban-cli/src/commands/contract/deploy/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ impl Cmd {
id: contract.into(),
};

let content = serde_json::to_string(&payload).map_err(Error::JsonSerialization)?;
let content = serde_json::to_string(&payload)?;

to_file.write_all(content.as_bytes()).map_err(Error::Io)
Ok(to_file.write_all(content.as_bytes())?)
}
}

Expand Down
6 changes: 2 additions & 4 deletions cmd/soroban-cli/src/commands/contract/invoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,8 @@ impl Cmd {
return Ok(None);
}

let content = fs::read_to_string(file_path).map_err(Error::Io)?;

let data: AliasData =
serde_json::from_str(content.as_str()).map_err(Error::JsonDeserialization)?;
let content = fs::read_to_string(file_path)?;
let data: AliasData = serde_json::from_str(content.as_str())?;

Ok(Some(data.id))
}
Expand Down

0 comments on commit faac4af

Please sign in to comment.