From d06f2266caebd72c4522703a856cb36ece82c311 Mon Sep 17 00:00:00 2001 From: Yuuki Takano Date: Tue, 14 Jan 2025 14:51:47 +0900 Subject: [PATCH] chore: add debug_assert_ne to check x is not zero Signed-off-by: Yuuki Takano --- futures-util/src/async_await/random.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/futures-util/src/async_await/random.rs b/futures-util/src/async_await/random.rs index 259a68052..e8d53e604 100644 --- a/futures-util/src/async_await/random.rs +++ b/futures-util/src/async_await/random.rs @@ -88,6 +88,7 @@ fn xorshift64star(mut x: Wrapping) -> (Wrapping, u64) { #[cfg(not(feature = "std"))] #[inline] fn xorshift32(mut x: u32) -> u32 { + debug_assert_ne!(x, 0); x ^= x << 13; x ^= x >> 17; x ^= x << 5;