diff --git a/cmd/soroban-cli/src/commands/contract/deploy/wasm.rs b/cmd/soroban-cli/src/commands/contract/deploy/wasm.rs index ddd3b2c74..e0fabdbac 100644 --- a/cmd/soroban-cli/src/commands/contract/deploy/wasm.rs +++ b/cmd/soroban-cli/src/commands/contract/deploy/wasm.rs @@ -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())?) } } diff --git a/cmd/soroban-cli/src/commands/contract/invoke.rs b/cmd/soroban-cli/src/commands/contract/invoke.rs index 51e4f477b..8dcebe9bf 100644 --- a/cmd/soroban-cli/src/commands/contract/invoke.rs +++ b/cmd/soroban-cli/src/commands/contract/invoke.rs @@ -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)) }