From e09663181c1b16aace3d6d28410700549061cad6 Mon Sep 17 00:00:00 2001 From: who-biz <37732338+who-biz@users.noreply.github.com> Date: Wed, 20 Dec 2023 17:16:24 -0500 Subject: [PATCH] Change 'unwrap' usage to '?' operator --- controller/src/command.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controller/src/command.rs b/controller/src/command.rs index 41d50b7a..de265200 100644 --- a/controller/src/command.rs +++ b/controller/src/command.rs @@ -448,7 +448,7 @@ where let method = args.method.as_str(); let mut slate; if method == "emoji" { - slate = EmojiSlate().decode(&args.input.as_str()).unwrap(); + slate = EmojiSlate().decode(&args.input.as_str())?; } else { slate = PathToSlate((&args.input).into()).get_tx()?; } @@ -889,7 +889,7 @@ where return Ok(()); } Some(f) => { - let mut tx_file = File::create(f.clone()).unwrap(); + let mut tx_file = File::create(f.clone())?; tx_file.write_all(json::to_string(&stored_tx).unwrap().as_bytes())?; tx_file.sync_all()?; info!("Dumped transaction data for tx {} to {}", args.id, f); @@ -1038,7 +1038,7 @@ where match result { Ok(p) => { // actually export proof - let mut proof_file = File::create(args.output_file.clone()).unwrap(); + let mut proof_file = File::create(args.output_file.clone())?; proof_file.write_all(json::to_string_pretty(&p).unwrap().as_bytes())?; proof_file.sync_all()?; warn!("Payment proof exported to {}", args.output_file);