From 723833f4e1ab867e9dafc7fed863321d96d507e8 Mon Sep 17 00:00:00 2001 From: Stjepan Glavina Date: Mon, 26 Jun 2017 11:20:31 +0200 Subject: [PATCH] Move thread_rng() outside the loop --- src/test/run-pass/vector-sort-panic-safe.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/run-pass/vector-sort-panic-safe.rs b/src/test/run-pass/vector-sort-panic-safe.rs index 3458199bdaf77..4387a43f03b6a 100644 --- a/src/test/run-pass/vector-sort-panic-safe.rs +++ b/src/test/run-pass/vector-sort-panic-safe.rs @@ -141,10 +141,11 @@ fn main() { } })); + let mut rng = thread_rng(); + for len in (1..20).chain(70..MAX_LEN) { for &modulus in &[5, 20, 50] { for &has_runs in &[false, true] { - let mut rng = thread_rng(); let mut input = (0..len) .map(|id| { DropCounter {