1
Fork 0

use par_for_each_in in par_body_owners and collect_crate_mono_items

This commit is contained in:
SparrowLii 2022-07-19 17:00:51 +08:00
parent 96c2df810b
commit e2ecb68a0e
6 changed files with 28 additions and 9 deletions

View file

@ -146,7 +146,7 @@ cfg_if! {
t.into_iter()
}
pub fn par_for_each_in<T: IntoIterator>(t: T, for_each: impl Fn(T::Item) + Sync + Send) {
pub fn par_for_each_in<T: IntoIterator>(t: T, mut for_each: impl FnMut(T::Item) + Sync + Send) {
// We catch panics here ensuring that all the loop iterations execute.
// This makes behavior consistent with the parallel compiler.
let mut panic = None;