about summary refs log tree commit diff
diff options
context:
space:
mode:
authorStjepan Glavina <stjepang@gmail.com>2017-06-26 11:20:31 +0200
committerStjepan Glavina <stjepang@gmail.com>2017-06-26 11:20:31 +0200
commit723833f4e1ab867e9dafc7fed863321d96d507e8 (patch)
tree8daefaf2e058d9dae3e4194164c1453dbcfda9c5
parent12205f1450f390f10602a19a4e40b6d8f26857e4 (diff)
downloadrust-723833f4e1ab867e9dafc7fed863321d96d507e8.tar.gz
rust-723833f4e1ab867e9dafc7fed863321d96d507e8.zip
Move thread_rng() outside the loop
-rw-r--r--src/test/run-pass/vector-sort-panic-safe.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/run-pass/vector-sort-panic-safe.rs b/src/test/run-pass/vector-sort-panic-safe.rs
index 3458199bdaf..4387a43f03b 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 {