2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-03-04 17:19:41 +00:00

Change recv_from to recv in UdpSocket::recv doc

This commit is contained in:
Bryant Luk 2019-12-02 13:04:19 -06:00
parent 128a6bc6ce
commit fd86effb63
No known key found for this signature in database
GPG key ID: 9E1D1BA8A0E87A8C

View file

@ -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(()) }) }
/// ```