Skip to content

Commit b9995a3

Browse files
authored
Rollup merge of rust-lang#92469 - joshtriplett:test-number-fix, r=Mark-Simulacrum
Make tidy check for magic numbers that spell things Remove existing problematic cases. r? `@Mark-Simulacrum`
2 parents df5dced + 7cc2b56 commit b9995a3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

std/src/net/ip.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,8 +1140,8 @@ impl From<Ipv4Addr> for u32 {
11401140
/// ```
11411141
/// use std::net::Ipv4Addr;
11421142
///
1143-
/// let addr = Ipv4Addr::new(0xca, 0xfe, 0xba, 0xbe);
1144-
/// assert_eq!(0xcafebabe, u32::from(addr));
1143+
/// let addr = Ipv4Addr::new(0x12, 0x34, 0x56, 0x78);
1144+
/// assert_eq!(0x12345678, u32::from(addr));
11451145
/// ```
11461146
#[inline]
11471147
fn from(ip: Ipv4Addr) -> u32 {
@@ -1159,8 +1159,8 @@ impl From<u32> for Ipv4Addr {
11591159
/// ```
11601160
/// use std::net::Ipv4Addr;
11611161
///
1162-
/// let addr = Ipv4Addr::from(0xcafebabe);
1163-
/// assert_eq!(Ipv4Addr::new(0xca, 0xfe, 0xba, 0xbe), addr);
1162+
/// let addr = Ipv4Addr::from(0x12345678);
1163+
/// assert_eq!(Ipv4Addr::new(0x12, 0x34, 0x56, 0x78), addr);
11641164
/// ```
11651165
#[inline]
11661166
fn from(ip: u32) -> Ipv4Addr {

0 commit comments

Comments
 (0)