use crate::parallel::Reducer; #[cfg(not(feature = "parallel"))] pub fn join(left: impl FnOnce() -> O1 + Send, right: impl FnOnce() -> O2 + Send) -> (O1, O2) { (left(), right()) } pub fn in_parallel( input: impl Iterator + Send, _thread_limit: Option, new_thread_state: impl Fn(usize) -> S + Send + Sync, consume: impl Fn(I, &mut S) -> O + Send + Sync, mut reducer: R, ) -> Result<::Output, ::Error> where R: Reducer, I: Send, O: Send, { let mut state = new_thread_state(0); for item in input { reducer.feed(consume(item, &mut state))?; } reducer.finalize() }