Skip to content

Commit 67a9aa2

Browse files
committed
Split the pool in iter_panic_fuse for formatting's sake
1 parent 42d1d4f commit 67a9aa2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/iter_panic.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
extern crate rayon;
22

33
use rayon::prelude::*;
4+
use rayon::ThreadPoolBuilder;
45
use std::ops::Range;
56
use std::panic::{self, UnwindSafe};
67
use std::sync::atomic::{AtomicUsize, Ordering};
@@ -24,7 +25,9 @@ fn iter_panic() {
2425
fn iter_panic_fuse() {
2526
// We only use a single thread in order to make the behavior
2627
// of 'panic_fuse' deterministic
27-
rayon::ThreadPoolBuilder::new().num_threads(1).build().unwrap().install(|| {
28+
let pool = ThreadPoolBuilder::new().num_threads(1).build().unwrap();
29+
30+
pool.install(|| {
2831
fn count(iter: impl ParallelIterator + UnwindSafe) -> usize {
2932
let count = AtomicUsize::new(0);
3033
let result = panic::catch_unwind(|| {

0 commit comments

Comments
 (0)