I'm confused how I can use StepRng with choose().
I validated that my StepRng is working as expected using the same code as the example:
let sample: [u64; 3] = rng.gen();
assert_eq!(sample, [2, 3, 4]);
While the returned integers do increase by 1, as expected, I was under the impression that it would also result in a predictable, but non-constant outcome of choose(), as long as I set the increment value of the RNG to anything other than 0.
However, it looks like I'm always getting the first element of my slice back. This isn't terrible, but it would be nice if this wasn't the case, so I could rule out some situation where the RNG isn't actually used, and the business logic is wired to always return the first value of a slice, which would be undesired behaviour.
I'm confused how I can use
StepRngwithchoose().I validated that my StepRng is working as expected using the same code as the example:
While the returned integers do increase by 1, as expected, I was under the impression that it would also result in a predictable, but non-constant outcome of
choose(), as long as I set theincrementvalue of the RNG to anything other than 0.However, it looks like I'm always getting the first element of my slice back. This isn't terrible, but it would be nice if this wasn't the case, so I could rule out some situation where the RNG isn't actually used, and the business logic is wired to always return the first value of a slice, which would be undesired behaviour.