Skip to content

Commit 0f610f3

Browse files
committed
Fixed not compiling code in docstring
1 parent d1ec703 commit 0f610f3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libstd/io/net/ip.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ impl FromStr for SocketAddr {
399399
///
400400
/// use std::io::{TcpStream, TcpListener};
401401
/// use std::io::net::udp::UdpSocket;
402-
/// use std::io::net::ip::{ToSocketAddr, Ipv4Addr, SocketAddr};
402+
/// use std::io::net::ip::{Ipv4Addr, SocketAddr};
403403
///
404404
/// fn main() {
405405
/// // The following lines are equivalent modulo possible "localhost" name resolution
@@ -414,7 +414,7 @@ impl FromStr for SocketAddr {
414414
/// // TcpListener::bind(), UdpSocket::bind() and UdpSocket::send_to() behave similarly
415415
/// let tcp_l = TcpListener::bind("localhost:12345");
416416
///
417-
/// let udp_s = UdpSocket::bind(("127.0.0.1", 23451u16));
417+
/// let mut udp_s = UdpSocket::bind(("127.0.0.1", 23451u16)).unwrap();
418418
/// udp_s.send_to([7u8, 7u8, 7u8].as_slice(), (Ipv4Addr(127, 0, 0, 1), 23451u16));
419419
/// }
420420
/// ```

0 commit comments

Comments
 (0)