Skip to content

Commit

Permalink
Update crates/tx5/src/backend/go_pion.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Callum Dunster <cdunster@users.noreply.github.com>
  • Loading branch information
neonphog and cdunster authored Oct 10, 2024
1 parent 781686d commit b93e474
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions crates/tx5/src/backend/go_pion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,11 @@ struct GoEpRecv(tx5_connection::HubRecv);
impl BackEpRecv for GoEpRecv {
fn recv(&mut self) -> BoxFuture<'_, Option<DynBackWaitCon>> {
Box::pin(async {
if let Some((con, con_recv)) = self.0.accept().await {
let pub_key = con.pub_key().clone();
let wc: DynBackWaitCon =
Box::new(GoWaitCon(pub_key, Some(con), Some(con_recv)));
Some(wc)
} else {
None
}
let (con, con_recv) = self.0.accept().await?;
let pub_key = con.pub_key().clone();
let wc: DynBackWaitCon =
Box::new(GoWaitCon(pub_key, Some(con), Some(con_recv)));
Some(wc)
})
}
}
Expand Down

0 comments on commit b93e474

Please sign in to comment.