Skip to content

Commit

Permalink
Rollup merge of #64728 - messense:udp-peer-addr, r=dtolnay
Browse files Browse the repository at this point in the history
Stabilize UdpSocket::peer_addr

Fixes #59127
  • Loading branch information
tmandry authored Oct 6, 2019
2 parents 0085263 + 1de6f74 commit 019b5b5
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.40.0")]
pub fn peer_addr(&self) -> io::Result<SocketAddr> {
self.0.peer_addr()
}
Expand Down

0 comments on commit 019b5b5

Please sign in to comment.