Skip to content

Commit e7bd951

Browse files
committed
fix typos in the example code in the doc comments of Ipv4Addr::from_bits() & Ipv6Addr::from_bits()
1 parent 3bf62cc commit e7bd951

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/core/src/net/ip_addr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ impl Ipv4Addr {
527527
/// ```
528528
/// use std::net::Ipv4Addr;
529529
///
530-
/// let addr = Ipv4Addr::from(0x12345678);
530+
/// let addr = Ipv4Addr::from_bits(0x12345678);
531531
/// assert_eq!(Ipv4Addr::new(0x12, 0x34, 0x56, 0x78), addr);
532532
/// ```
533533
#[rustc_const_stable(feature = "ip_bits", since = "1.80.0")]
@@ -1330,7 +1330,7 @@ impl Ipv6Addr {
13301330
/// ```
13311331
/// use std::net::Ipv6Addr;
13321332
///
1333-
/// let addr = Ipv6Addr::from(0x102030405060708090A0B0C0D0E0F00D_u128);
1333+
/// let addr = Ipv6Addr::from_bits(0x102030405060708090A0B0C0D0E0F00D_u128);
13341334
/// assert_eq!(
13351335
/// Ipv6Addr::new(
13361336
/// 0x1020, 0x3040, 0x5060, 0x7080,

0 commit comments

Comments
 (0)