Skip to content

Commit f394230

Browse files
committed
Use !0 instead of usize::MAX
We could use core::usize::MAX, but that is deprecated. Signed-off-by: Joe Richey <[email protected]>
1 parent 82c3cb8 commit f394230

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rdrand.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ compile_error!(
5050
// Fails with probability < 2^(-90) on 32-bit systems
5151
#[target_feature(enable = "rdrand")]
5252
unsafe fn self_test() -> bool {
53-
// On AMD, RDRAND returns usize::MAX on failure, count it as a collision.
54-
let mut prev = usize::MAX;
53+
// On AMD, RDRAND returns 0xFF...FF on failure, count it as a collision.
54+
let mut prev = !0; // TODO(MSRV 1.43): Move to usize::MAX
5555
let mut fails = 0;
5656
for _ in 0..8 {
5757
match rdrand() {

0 commit comments

Comments
 (0)