Closed ghost closed 3 years ago
Was it on purpose that you removed the snippet about distributions ?
// Sometimes it's useful to use distributions directly:
let distr = rand::distributions::Uniform::new_inclusive(1, 100);
let mut nums = [0i32; 3];
for x in &mut nums {
*x = rng.sample(distr);
}
I thought it was not and I put it back in the playground.
No, it wasn't; not sure how that happened. Your version is still missing the "print nums" line (check "files changed" tab) which is probably worth having.
Sorry about that. Should be fixed now.
Previous version did not work on the playground which seems to use the latest version of rand.