From f39423084cf1f7958aea0c088b15c83a19b1c677 Mon Sep 17 00:00:00 2001 From: Joe Richey Date: Mon, 6 Feb 2023 13:11:42 -0800 Subject: [PATCH] Use !0 instead of usize::MAX We could use core::usize::MAX, but that is deprecated. Signed-off-by: Joe Richey --- src/rdrand.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rdrand.rs b/src/rdrand.rs index 14dd8ed..c2e5297 100644 --- a/src/rdrand.rs +++ b/src/rdrand.rs @@ -50,8 +50,8 @@ compile_error!( // Fails with probability < 2^(-90) on 32-bit systems #[target_feature(enable = "rdrand")] unsafe fn self_test() -> bool { - // On AMD, RDRAND returns usize::MAX on failure, count it as a collision. - let mut prev = usize::MAX; + // On AMD, RDRAND returns 0xFF...FF on failure, count it as a collision. + let mut prev = !0; // TODO(MSRV 1.43): Move to usize::MAX let mut fails = 0; for _ in 0..8 { match rdrand() {