diff --git a/idna/src/punycode.rs b/idna/src/punycode.rs index 2d6d4139..6a330889 100644 --- a/idna/src/punycode.rs +++ b/idna/src/punycode.rs @@ -17,7 +17,6 @@ use alloc::{string::String, vec::Vec}; use core::char; use core::fmt::Write; use core::marker::PhantomData; -use core::u32; // Bootstring parameters for Punycode const BASE: u32 = 36; diff --git a/url/src/host.rs b/url/src/host.rs index 62db3b46..7864b77d 100644 --- a/url/src/host.rs +++ b/url/src/host.rs @@ -309,7 +309,7 @@ fn parse_ipv4addr(input: &str) -> ParseResult { } let mut ipv4 = numbers.pop().expect("a non-empty list of numbers"); // Equivalent to: ipv4 >= 256 ** (4 − numbers.len()) - if ipv4 > u32::max_value() >> (8 * numbers.len() as u32) { + if ipv4 > u32::MAX >> (8 * numbers.len() as u32) { return Err(ParseError::InvalidIpv4Address); } if numbers.iter().any(|x| *x > 255) { diff --git a/url/src/parser.rs b/url/src/parser.rs index 2e3a4f64..8dd054df 100644 --- a/url/src/parser.rs +++ b/url/src/parser.rs @@ -1109,7 +1109,7 @@ impl<'a> Parser<'a> { while let (Some(c), remaining) = input.split_first() { if let Some(digit) = c.to_digit(10) { port = port * 10 + digit; - if port > ::std::u16::MAX as u32 { + if port > u16::MAX as u32 { return Err(ParseError::InvalidPort); } has_any_digit = true; @@ -1590,7 +1590,7 @@ pub fn ascii_alpha(ch: char) -> bool { #[inline] pub fn to_u32(i: usize) -> ParseResult { - if i <= ::std::u32::MAX as usize { + if i <= u32::MAX as usize { Ok(i as u32) } else { Err(ParseError::Overflow)