Skip to content

Commit d567e43

Browse files
authored
Merge pull request #236 from gents83/patch-1
Fixing issue with worker on wasm targets
2 parents 3ff8d14 + 04a9613 commit d567e43

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/worker/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,15 @@ pub enum PreferWorkerKind {
3434
Multithreaded,
3535
}
3636

37+
3738
/// Execute something with a worker system.
3839
pub fn with_worker<T>(prefer: PreferWorkerKind, f: impl FnOnce(&mut dyn Worker) -> T) -> T {
3940
match prefer {
40-
#[cfg(not(any(target_arch = "asmjs", target_arch = "wasm32")))]
41-
#[cfg(feature = "rayon")]
41+
#[cfg(all(not(any(target_arch = "asmjs", target_arch = "wasm32")), feature = "rayon"))]
4242
PreferWorkerKind::Multithreaded => self::rayon::with_rayon(f),
4343
#[cfg(not(any(target_arch = "asmjs", target_arch = "wasm32")))]
4444
PreferWorkerKind::Multithreaded => self::multithreaded::with_multithreading(f),
4545
_ => self::immediate::with_immediate(f),
4646
}
4747
}
48+

0 commit comments

Comments
 (0)