diff options
author | Simon Wülker <simon.wuelker@arcor.de> | 2024-08-16 23:30:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-16 21:30:13 +0000 |
commit | f0045a76866f2d56d6a01aaf93ec20177dad778a (patch) | |
tree | 2f6749890384a1fcd0fd4d361f0cbd973b3815aa /components/script/dom/htmlcollection.rs | |
parent | 09cac6430bfc98dace01ccf2a0af40c2420a4d19 (diff) | |
download | servo-f0045a76866f2d56d6a01aaf93ec20177dad778a.tar.gz servo-f0045a76866f2d56d6a01aaf93ec20177dad778a.zip |
remove usage of legacy numeric operations in script (#33095)
These operations are deprecated and might be removed
in a future rust version. Clippy is also complaining
about them.
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
Diffstat (limited to 'components/script/dom/htmlcollection.rs')
-rw-r--r-- | components/script/dom/htmlcollection.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/components/script/dom/htmlcollection.rs b/components/script/dom/htmlcollection.rs index c83c4125f2d..24e71f482e5 100644 --- a/components/script/dom/htmlcollection.rs +++ b/components/script/dom/htmlcollection.rs @@ -25,7 +25,7 @@ pub trait CollectionFilter: JSTraceable { fn filter<'a>(&self, elem: &'a Element, root: &'a Node) -> bool; } -/// An optional u32, using maxint to represent None. +/// An optional u32, using u32::MAX to represent None. /// It would be nicer just to use Option<u32> for this, but that would produce word /// alignment issues since Option<u32> uses 33 bits. #[derive(Clone, Copy, JSTraceable, MallocSizeOf)] @@ -35,7 +35,7 @@ struct OptionU32 { impl OptionU32 { fn to_option(self) -> Option<u32> { - if self.bits == u32::max_value() { + if self.bits == u32::MAX { None } else { Some(self.bits) @@ -43,14 +43,12 @@ impl OptionU32 { } fn some(bits: u32) -> OptionU32 { - assert_ne!(bits, u32::max_value()); + assert_ne!(bits, u32::MAX); OptionU32 { bits } } fn none() -> OptionU32 { - OptionU32 { - bits: u32::max_value(), - } + OptionU32 { bits: u32::MAX } } } |