Skip to content

Commit

Permalink
more idiomatic
Browse files Browse the repository at this point in the history
  • Loading branch information
Catrya committed Dec 10, 2024
1 parent 0a94986 commit ecb5835
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ pub async fn order_action(
amount_vec.push(max);
}

if order.premium != 0 && order.amount != 0 && order.fiat_amount != 0 {
let premium = (order.premium != 0).then_some(order.premium);
let amount = (order.amount != 0).then_some(order.amount);
let fiat_amount = (order.fiat_amount != 0).then_some(order.fiat_amount);

if premium.is_some() && amount.is_some() && fiat_amount.is_some() {
send_cant_do_msg(request_id, None, None, &event.sender).await;
return Ok(());
}
Expand Down

0 comments on commit ecb5835

Please sign in to comment.