From b93e474b81363c93cf525779bf9993c7f133ad15 Mon Sep 17 00:00:00 2001 From: David Braden Date: Thu, 10 Oct 2024 11:39:01 -0600 Subject: [PATCH] Update crates/tx5/src/backend/go_pion.rs Co-authored-by: Callum Dunster --- crates/tx5/src/backend/go_pion.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/crates/tx5/src/backend/go_pion.rs b/crates/tx5/src/backend/go_pion.rs index ee3974e..3dd552b 100644 --- a/crates/tx5/src/backend/go_pion.rs +++ b/crates/tx5/src/backend/go_pion.rs @@ -96,14 +96,11 @@ struct GoEpRecv(tx5_connection::HubRecv); impl BackEpRecv for GoEpRecv { fn recv(&mut self) -> BoxFuture<'_, Option> { 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) }) } }