Skip to content

Commit

Permalink
chore: Convert if let else to a one liner.
Browse files Browse the repository at this point in the history
  • Loading branch information
ceyhunsen committed Feb 8, 2025
1 parent ade8477 commit ff53e32
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions core/src/rpc/parser/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,10 @@ pub async fn parse_withdrawal_sig_params(
let user_sig = Signature::from_slice(&params.user_sig)
.map_err(|e| error::invalid_argument("user_sig", "Can't convert input to Signature")(e))?;

let users_intent_outpoint: OutPoint = if let Some(o) = params.users_intent_outpoint {
o.try_into()?
} else {
return Err(error::input_ended_prematurely());
};
let users_intent_outpoint: OutPoint = params
.users_intent_outpoint
.ok_or_else(error::input_ended_prematurely)?
.try_into()?;

let users_intent_script_pubkey = ScriptBuf::from_bytes(params.users_intent_script_pubkey);

Expand Down

0 comments on commit ff53e32

Please sign in to comment.