From d8e8037de50d12162626d35498d1348538bbf38a Mon Sep 17 00:00:00 2001 From: Martin Grigorov Date: Wed, 10 Sep 2025 17:33:35 +0300 Subject: [PATCH] net: fix copy/paste errors in udp peek methods (#7604) --- tokio/src/net/udp.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tokio/src/net/udp.rs b/tokio/src/net/udp.rs index 1b580d4c2..44fa9ba35 100644 --- a/tokio/src/net/udp.rs +++ b/tokio/src/net/udp.rs @@ -1516,7 +1516,7 @@ impl UdpSocket { /// # Notes /// /// On Windows, if the data is larger than the buffer specified, the buffer - /// is filled with the first part of the data, and `peek_from` returns the error + /// is filled with the first part of the data, and peek returns the error /// `WSAEMSGSIZE(10040)`. The excess data is lost. /// Make sure to always use a sufficiently large buffer to hold the /// maximum UDP packet size, which can be up to 65536 bytes in size. @@ -1561,7 +1561,6 @@ impl UdpSocket { } /// Receives data from the connected address, without removing it from the input queue. - /// On success, returns the sending address of the datagram. /// /// # Notes /// @@ -1611,7 +1610,7 @@ impl UdpSocket { self.io.peek(b) }))?; - // Safety: We trust `recv` to have filled up `n` bytes in the buffer. + // Safety: We trust `peek` to have filled up `n` bytes in the buffer. unsafe { buf.assume_init(n); }