Use !0 instead of usize::MAX

We could use core::usize::MAX, but that is deprecated.

Signed-off-by: Joe Richey <joerichey@google.com>
This commit is contained in:
Joe Richey
2023-02-06 13:11:42 -08:00
parent 82c3cb8901
commit f39423084c
+2 -2
View File
@@ -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() {