Skip to content

Commit

Permalink
Stabilize UdpSocket::peer_addr
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Sep 24, 2019
1 parent 66bf391 commit f1835bc
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/libstd/net/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ impl UdpSocket {
/// # Examples
///
/// ```no_run
/// #![feature(udp_peer_addr)]
/// use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4, UdpSocket};
///
/// let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
Expand All @@ -199,14 +198,13 @@ impl UdpSocket {
/// [`NotConnected`]: ../../std/io/enum.ErrorKind.html#variant.NotConnected
///
/// ```no_run
/// #![feature(udp_peer_addr)]
/// use std::net::UdpSocket;
///
/// let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
/// assert_eq!(socket.peer_addr().unwrap_err().kind(),
/// ::std::io::ErrorKind::NotConnected);
/// ```
#[unstable(feature = "udp_peer_addr", issue = "59127")]
#[stable(feature = "udp_peer_addr", since = "1.39.0")]
pub fn peer_addr(&self) -> io::Result<SocketAddr> {
self.0.peer_addr()
}
Expand Down

0 comments on commit f1835bc

Please sign in to comment.