Skip to content

Commit 03aef02

Browse files
committed
Use IPv6 addresses in hop_limit_v6 docs
1 parent 5ce4d0d commit 03aef02

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Diff for: library/std/src/net/tcp.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ impl TcpStream {
559559
/// #![feature(ipv6_hop_limit)]
560560
/// use std::net::TcpStream;
561561
///
562-
/// let stream = TcpStream::connect("127.0.0.1:54321")
562+
/// let stream = TcpStream::connect("[::1]:12345")
563563
/// .expect("Couldn't connect to the server...");
564564
/// stream.set_hop_limit_v6(88).expect("set_hop_limit_v6 call failed");
565565
/// ```
@@ -578,7 +578,7 @@ impl TcpStream {
578578
/// #![feature(ipv6_hop_limit)]
579579
/// use std::net::TcpStream;
580580
///
581-
/// let stream = TcpStream::connect("127.0.0.1:54321")
581+
/// let stream = TcpStream::connect("[::1]:12345")
582582
/// .expect("Couldn't connect to the server...");
583583
/// stream.set_hop_limit_v6(88).expect("set_hop_limit_v6 call failed");
584584
/// assert_eq!(stream.hop_limit_v6().unwrap(), 88);
@@ -993,7 +993,7 @@ impl TcpListener {
993993
/// #![feature(ipv6_hop_limit)]
994994
/// use std::net::TcpListener;
995995
///
996-
/// let listener = TcpListener::bind("127.0.0.1:54321").unwrap();
996+
/// let listener = TcpListener::bind("[::1]:12345").unwrap();
997997
/// listener.set_hop_limit_v6(88).expect("set_hop_limit_v6 call failed");
998998
/// ```
999999
#[unstable(feature = "ipv6_hop_limit", issue = "47727")]
@@ -1011,7 +1011,7 @@ impl TcpListener {
10111011
/// #![feature(ipv6_hop_limit)]
10121012
/// use std::net::TcpListener;
10131013
///
1014-
/// let listener = TcpListener::bind("127.0.0.1:80").unwrap();
1014+
/// let listener = TcpListener::bind("[::1]:12345").unwrap();
10151015
/// listener.set_hop_limit_v6(88).expect("set_hop_limit_v6 call failed");
10161016
/// assert_eq!(listener.hop_limit_v6().unwrap(), 88);
10171017
/// ```

Diff for: library/std/src/net/udp.rs

+4-4
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)