Skip to content

Commit

Permalink
Mark UdpSocket peer_addr unstable w/ tracking issue
Browse files Browse the repository at this point in the history
  • Loading branch information
LinusU committed Mar 16, 2019
1 parent a7bd36c commit bf473e3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libstd/net/udp.rs
Expand Up @@ -185,14 +185,15 @@ 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");
/// socket.connect("192.168.0.1:41203").expect("couldn't connect to address");
/// assert_eq!(socket.peer_addr().unwrap(),
/// SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::new(192, 168, 0, 1), 41203)));
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[unstable(feature = "udp_peer_addr", issue = "59127")]
pub fn peer_addr(&self) -> io::Result<SocketAddr> {
self.0.peer_addr()
}
Expand Down

0 comments on commit bf473e3

Please sign in to comment.