Skip to content

Commit efdbadb

Browse files
committed
Use IPv6 addresses in hop_limit_v6 docs
1 parent 38fc880 commit efdbadb

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

library/std/src/net/tcp.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ impl TcpStream {
565565
/// #![feature(ipv6_hop_limit)]
566566
/// use std::net::TcpStream;
567567
///
568-
/// let stream = TcpStream::connect("127.0.0.1:54321")
568+
/// let stream = TcpStream::connect("[::1]:12345")
569569
/// .expect("Couldn't connect to the server...");
570570
/// stream.set_hop_limit_v6(88).expect("set_hop_limit_v6 call failed");
571571
/// ```
@@ -584,7 +584,7 @@ impl TcpStream {
584584
/// #![feature(ipv6_hop_limit)]
585585
/// use std::net::TcpStream;
586586
///
587-
/// let stream = TcpStream::connect("127.0.0.1:54321")
587+
/// let stream = TcpStream::connect("[::1]:12345")
588588
/// .expect("Couldn't connect to the server...");
589589
/// stream.set_hop_limit_v6(88).expect("set_hop_limit_v6 call failed");
590590
/// assert_eq!(stream.hop_limit_v6().unwrap(), 88);
@@ -999,7 +999,7 @@ impl TcpListener {
999999
/// #![feature(ipv6_hop_limit)]
10001000
/// use std::net::TcpListener;
10011001
///
1002-
/// let listener = TcpListener::bind("127.0.0.1:54321").unwrap();
1002+
/// let listener = TcpListener::bind("[::1]:12345").unwrap();
10031003
/// listener.set_hop_limit_v6(88).expect("set_hop_limit_v6 call failed");
10041004
/// ```
10051005
#[unstable(feature = "ipv6_hop_limit", issue = "47727")]
@@ -1017,7 +1017,7 @@ impl TcpListener {
10171017
/// #![feature(ipv6_hop_limit)]
10181018
/// use std::net::TcpListener;
10191019
///
1020-
/// let listener = TcpListener::bind("127.0.0.1:80").unwrap();
1020+
/// let listener = TcpListener::bind("[::1]:12345").unwrap();
10211021
/// listener.set_hop_limit_v6(88).expect("set_hop_limit_v6 call failed");
10221022
/// assert_eq!(listener.hop_limit_v6().unwrap(), 88);
10231023
/// ```

library/std/src/net/udp.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ impl UdpSocket {
593593
/// #![feature(ipv6_hop_limit)]
594594
/// use std::net::UdpSocket;
595595
///
596-
/// let socket = UdpSocket::bind("127.0.0.1:54321").expect("couldn't bind to address");
596+
/// let socket = UdpSocket::bind("[::1]:12345").expect("couldn't bind to address");
597597
/// socket.set_hop_limit_v6(88).expect("set_hop_limit_v6 call failed");
598598
/// ```
599599
#[unstable(feature = "ipv6_hop_limit", issue = "47727")]
@@ -611,7 +611,7 @@ impl UdpSocket {
611611
/// #![feature(ipv6_hop_limit)]
612612
/// use std::net::UdpSocket;
613613
///
614-
/// let socket = UdpSocket::bind("127.0.0.1:54321").expect("couldn't bind to address");
614+
/// let socket = UdpSocket::bind("[::1]:12345").expect("couldn't bind to address");
615615
/// socket.set_hop_limit_v6(88).expect("set_hop_limit_v6 call failed");
616616
/// assert_eq!(socket.hop_limit_v6().unwrap(), 88);
617617
/// ```
@@ -631,7 +631,7 @@ impl UdpSocket {
631631
/// #![feature(ipv6_hop_limit)]
632632
/// use std::net::UdpSocket;
633633
///
634-
/// let socket = UdpSocket::bind("127.0.0.1:54321").expect("couldn't bind to address");
634+
/// let socket = UdpSocket::bind("[::1]:12345").expect("couldn't bind to address");
635635
/// socket.set_multicast_hop_limit_v6(88).expect("set_multicast_hop_limit_v6 call failed");
636636
/// ```
637637
#[unstable(feature = "ipv6_hop_limit", issue = "47727")]
@@ -649,7 +649,7 @@ impl UdpSocket {
649649
/// #![feature(ipv6_hop_limit)]
650650
/// use std::net::UdpSocket;
651651
///
652-
/// let socket = UdpSocket::bind("127.0.0.1:54321").expect("couldn't bind to address");
652+
/// let socket = UdpSocket::bind("[::1]:12345").expect("couldn't bind to address");
653653
/// socket.set_multicast_hop_limit_v6(88).expect("set_multicast_hop_limit_v6 call failed");
654654
/// assert_eq!(socket.multicast_hop_limit_v6().unwrap(), 88);
655655
/// ```

0 commit comments

Comments
 (0)