Skip to content

Commit f29e468

Browse files
committed
Do not just unwrap.
1 parent 4bccf5b commit f29e468

File tree

1 file changed

+2
-2
lines changed
  • cmd/soroban-cli/src/commands/tx

1 file changed

+2
-2
lines changed

cmd/soroban-cli/src/commands/tx/edit.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ where
155155
{
156156
let version = env!("CARGO_PKG_VERSION");
157157
let tx = T::from_xdr_base64(xdr_string, curr::Limits::none())?;
158-
let mut schema: serde_json::Value = serde_json::to_value(tx).unwrap();
158+
let mut schema: serde_json::Value = serde_json::to_value(tx)?;
159159
schema["$schema"] = json!(format!(
160160
"https://github.com/stellar/stellar-cli/releases/download/v{version}/stellar-xdr-{version}.json"
161161
));
@@ -168,7 +168,7 @@ fn json_to_xdr<T>(json_string: &str) -> Result<String, Error>
168168
where
169169
T: serde::de::DeserializeOwned + curr::WriteXdr,
170170
{
171-
let mut schema: serde_json::Value = serde_json::from_str(json_string).unwrap();
171+
let mut schema: serde_json::Value = serde_json::from_str(json_string)?;
172172

173173
if let Some(obj) = schema.as_object_mut() {
174174
obj.remove("$schema");

0 commit comments

Comments
 (0)