This commit is contained in:
Antonio Scandurra 2022-01-10 16:10:29 +01:00
parent b44ae46559
commit 4992a8a407

View File

@ -848,14 +848,13 @@ mod tests {
let server = FakeServer::for_client(user_id, &mut client, &cx).await;
let model = cx.add_model(|_| Model { subscription: None });
let (done_tx, mut done_rx) = postage::oneshot::channel();
let mut done_tx = Some(done_tx);
let (mut done_tx, mut done_rx) = postage::oneshot::channel();
model.update(&mut cx, |model, cx| {
model.subscription = Some(client.subscribe(
cx,
move |model, _: TypedEnvelope<proto::Ping>, _, _| {
model.subscription.take();
postage::sink::Sink::try_send(&mut done_tx.take().unwrap(), ()).unwrap();
postage::sink::Sink::try_send(&mut done_tx, ()).unwrap();
Ok(())
},
));