From fd86effb635b2bc5b3f2fe9bb5c506f3b62ee051 Mon Sep 17 00:00:00 2001 From: Bryant Luk Date: Mon, 2 Dec 2019 13:04:19 -0600 Subject: [PATCH] Change recv_from to recv in UdpSocket::recv doc --- src/net/udp/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/net/udp/mod.rs b/src/net/udp/mod.rs index 7fef1ed5..418b4b60 100644 --- a/src/net/udp/mod.rs +++ b/src/net/udp/mod.rs @@ -298,10 +298,11 @@ impl UdpSocket { /// use async_std::net::UdpSocket; /// /// let socket = UdpSocket::bind("127.0.0.1:0").await?; + /// socket.connect("127.0.0.1:8080").await?; /// /// let mut buf = vec![0; 1024]; - /// let (n, peer) = socket.recv_from(&mut buf).await?; - /// println!("Received {} bytes from {}", n, peer); + /// let n = socket.recv(&mut buf).await?; + /// println!("Received {} bytes", n); /// # /// # Ok(()) }) } /// ```