Skip to content

Commit

Permalink
Change 'unwrap' usage to '?' operator
Browse files Browse the repository at this point in the history
  • Loading branch information
who-biz committed Dec 20, 2023
1 parent 0fce73c commit e096631
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions controller/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()?;
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit e096631

Please sign in to comment.