From 8fe88847d81afceaa55aa68662d4162d5c12f804 Mon Sep 17 00:00:00 2001 From: chrysn Date: Mon, 15 Apr 2024 10:02:35 +0200 Subject: [PATCH] fixup! net/udp: Relay full UdpMetadata instead of only remote endpoint in poll_ functions --- embassy-net/src/udp.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/embassy-net/src/udp.rs b/embassy-net/src/udp.rs index 2fdf83e9d..3e72327c6 100644 --- a/embassy-net/src/udp.rs +++ b/embassy-net/src/udp.rs @@ -111,10 +111,8 @@ impl<'a> UdpSocket<'a> { /// This method will wait until a datagram is received. /// /// Returns the number of bytes received and the remote endpoint. - pub async fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, IpEndpoint), RecvError> { - poll_fn(move |cx| self.poll_recv_from(buf, cx)) - .await - .map(|(size, metadata)| (size, metadata.endpoint)) + pub async fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, UdpMetadata), RecvError> { + poll_fn(move |cx| self.poll_recv_from(buf, cx)).await } /// Receive a datagram.