Skip to content

Commit

Permalink
chore: add debug_assert_ne to check x is not zero
Browse files Browse the repository at this point in the history
Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>
  • Loading branch information
ytakano committed Jan 14, 2025
1 parent b71bf7e commit d06f226
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions futures-util/src/async_await/random.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ fn xorshift64star(mut x: Wrapping<u64>) -> (Wrapping<u64>, 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;
Expand Down

0 comments on commit d06f226

Please sign in to comment.