diff --git a/jabber/src/client.rs b/jabber/src/client.rs index 32b8f6e..f5d5dc7 100644 --- a/jabber/src/client.rs +++ b/jabber/src/client.rs @@ -349,12 +349,11 @@ mod tests { sleep(Duration::from_secs(5)).await; let jid = client.jid.clone(); let server = client.server.clone(); - let mut client = Arc::new(Mutex::new(client)); + let (mut write, mut read) = client.split(); tokio::join!( async { - let mut client = client.lock().await; - client + write .send(Stanza::Iq(Iq { from: Some(jid.clone()), id: "c2s1".to_string(), @@ -365,10 +364,7 @@ mod tests { errors: Vec::new(), })) .await; - }, - async { - let mut client = client.lock().await; - client + write .send(Stanza::Iq(Iq { from: Some(jid.clone()), id: "c2s2".to_string(), @@ -381,7 +377,7 @@ mod tests { .await; }, async { - while let Some(stanza) = client.lock().await.next().await { + while let Some(stanza) = read.next().await { info!("{:#?}", stanza); } }