From faac4afff15770b59e843f50f95a70ff35d359fe Mon Sep 17 00:00:00 2001 From: Nando Vieira Date: Thu, 6 Jun 2024 10:56:14 -0700 Subject: [PATCH] Remove map_err in favor of macro implementation. --- cmd/soroban-cli/src/commands/contract/deploy/wasm.rs | 4 ++-- cmd/soroban-cli/src/commands/contract/invoke.rs | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) 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)) }