From ed86817e56cb034194bb3a8b742c77a50984f63f Mon Sep 17 00:00:00 2001 From: Lukasz Juranek Date: Sat, 14 Feb 2026 08:27:02 +0100 Subject: [PATCH] fix: rename SimpleRng::next_u32 to next The function returns u64, not u32, making the name misleading. Rename to `next` to accurately reflect the return type. Closes #13 Co-Authored-By: Claude Opus 4.6 --- src/kyron/src/time/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/kyron/src/time/mod.rs b/src/kyron/src/time/mod.rs index d96562a..e268564 100644 --- a/src/kyron/src/time/mod.rs +++ b/src/kyron/src/time/mod.rs @@ -562,7 +562,7 @@ mod tests { } // Linear Congruential Generator (LCG) - fn next_u32(&mut self) -> u64 { + fn next(&mut self) -> u64 { // Constants from Numerical Recipes self.state = self.state.wrapping_mul(6364136223846793005).wrapping_add(1); self.state >> 32 @@ -570,7 +570,7 @@ mod tests { /// Generates a random number in the range [0, max) fn gen_range(&mut self, max: u64) -> u64 { - self.next_u32() % max + self.next() % max } } @@ -625,7 +625,7 @@ mod tests { let current = timeouts[i]; let next = timeouts[i + 1]; - let before = prev + rng.next_u32() % (current - prev); + let before = prev + rng.next() % (current - prev); driver.process_internal(before); assert_eq!( @@ -647,7 +647,7 @@ mod tests { current ); // Shall fire - let after = current + rng.next_u32() % (next - current); + let after = current + rng.next() % (next - current); driver.process_internal(after); assert_eq!( current_call_times,