From dd0ee71eba49522683d98951b86bb5247cd454c0 Mon Sep 17 00:00:00 2001 From: proxima424 Date: Sun, 22 Sep 2024 05:54:59 +0530 Subject: [PATCH] returns None on empty vec --- crates/rbuilder/src/building/block_orders/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/rbuilder/src/building/block_orders/mod.rs b/crates/rbuilder/src/building/block_orders/mod.rs index 6a213c1a..b9c1c63f 100644 --- a/crates/rbuilder/src/building/block_orders/mod.rs +++ b/crates/rbuilder/src/building/block_orders/mod.rs @@ -88,7 +88,7 @@ impl SimulatedOrderStore { /// Allows to get new adds ONLY if no remove_order was received pub fn drain_new_orders(&mut self) -> Option> { - self.new_orders.replace(Vec::new()) + self.new_orders.take().filter(|v| !v.is_empty()) } }