Skip to content

Commit

Permalink
Rollup merge of #134518 - hltj:typo-fix, r=tgross35
Browse files Browse the repository at this point in the history
fix typos in the example code in the doc comments of `Ipv4Addr::from_bits()`, `Ipv6Addr::from_bits()` & `Ipv6Addr::to_bits()`
  • Loading branch information
jhpratt authored Dec 20, 2024
2 parents f14d69c + eef7498 commit ef47ba0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/core/src/net/ip_addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ impl Ipv4Addr {
/// ```
/// use std::net::Ipv4Addr;
///
/// let addr = Ipv4Addr::from(0x12345678);
/// let addr = Ipv4Addr::from_bits(0x12345678);
/// assert_eq!(Ipv4Addr::new(0x12, 0x34, 0x56, 0x78), addr);
/// ```
#[rustc_const_stable(feature = "ip_bits", since = "1.80.0")]
Expand Down Expand Up @@ -1294,7 +1294,7 @@ impl Ipv6Addr {
/// 0x1020, 0x3040, 0x5060, 0x7080,
/// 0x90A0, 0xB0C0, 0xD0E0, 0xF00D,
/// );
/// assert_eq!(0x102030405060708090A0B0C0D0E0F00D_u128, u128::from(addr));
/// assert_eq!(0x102030405060708090A0B0C0D0E0F00D_u128, addr.to_bits());
/// ```
///
/// ```
Expand Down Expand Up @@ -1330,7 +1330,7 @@ impl Ipv6Addr {
/// ```
/// use std::net::Ipv6Addr;
///
/// let addr = Ipv6Addr::from(0x102030405060708090A0B0C0D0E0F00D_u128);
/// let addr = Ipv6Addr::from_bits(0x102030405060708090A0B0C0D0E0F00D_u128);
/// assert_eq!(
/// Ipv6Addr::new(
/// 0x1020, 0x3040, 0x5060, 0x7080,
Expand Down

0 comments on commit ef47ba0

Please sign in to comment.