From ecb5835848f64875d2effec5c0ed6b2692513fe9 Mon Sep 17 00:00:00 2001 From: Catrya <140891948+Catrya@users.noreply.github.com> Date: Tue, 10 Dec 2024 17:40:59 -0500 Subject: [PATCH] more idiomatic --- src/app/order.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/order.rs b/src/app/order.rs index 6edd3698..e2fa6f2c 100644 --- a/src/app/order.rs +++ b/src/app/order.rs @@ -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(()); }