From a342df03f0a2e1e3aba7ea3687efa2da9591ab0e Mon Sep 17 00:00:00 2001 From: Greg Guthe <226605+g-k@users.noreply.github.com> Date: Tue, 18 Jan 2022 08:47:39 -0500 Subject: [PATCH] tests: update factor Distribution sample to take range --- src/uu/factor/src/factor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uu/factor/src/factor.rs b/src/uu/factor/src/factor.rs index 54ad0bdd4..e32b36db6 100644 --- a/src/uu/factor/src/factor.rs +++ b/src/uu/factor/src/factor.rs @@ -258,7 +258,7 @@ impl Distribution for Standard { // See Generating Random Factored Numbers, Easily, J. Cryptology (2003) 'attempt: loop { while n > 1 { - n = rng.gen_range(1, n); + n = rng.gen_range(1..n); if miller_rabin::is_prime(n) { if let Some(h) = g.checked_mul(n) { f.push(n);