Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
d-e-s-o committed Jan 15, 2023
1 parent 9a09e10 commit 25ecd73
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/api/v2/orders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,9 @@ Endpoint! {
mod tests {
use super::*;

use futures::future::ok;
use futures::future::ready;
use futures::pin_mut;
use futures::StreamExt;
use futures::TryStreamExt;

use num_decimal::Num;

Expand Down Expand Up @@ -166,19 +165,18 @@ mod tests {

// Wait until we see the "canceled" event.
let _update = stream
.try_filter_map(|res| {
let update = res.unwrap();
ok(Some(update))
.filter_map(|res| {
let update = res.unwrap().unwrap();
ready(Some(update))
})
// There could be other orders happening concurrently but we are
// only interested in ones belonging to the order canceled
// earlier.
.try_skip_while(|update| {
ok(update.order.id != id || !matches!(update.event, updates::OrderStatus::Canceled))
.skip_while(|update| {
ready(update.order.id != id || !matches!(update.event, updates::OrderStatus::Canceled))
})
.next()
.await
.unwrap()
.unwrap();
}

Expand Down

0 comments on commit 25ecd73

Please sign in to comment.