Skip to content

Commit 7824a9d

Browse files
authored
Rollup merge of #69500 - cuviper:par_for_each_in-item, r=Mark-Simulacrum
Simplify the signature of par_for_each_in Given `T: IntoIterator`/`IntoParallelIterator`, `T::Item` is unambiguous, so we don't need the explicit trait casting.
2 parents 6e66bfd + 3d47ebe commit 7824a9d

File tree

1 file changed

+2
-8
lines changed
  • src/librustc_data_structures

1 file changed

+2
-8
lines changed

src/librustc_data_structures/sync.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,7 @@ cfg_if! {
203203
t.into_iter()
204204
}
205205

206-
pub fn par_for_each_in<T: IntoIterator>(
207-
t: T,
208-
for_each:
209-
impl Fn(<<T as IntoIterator>::IntoIter as Iterator>::Item) + Sync + Send
210-
) {
206+
pub fn par_for_each_in<T: IntoIterator>(t: T, for_each: impl Fn(T::Item) + Sync + Send) {
211207
// We catch panics here ensuring that all the loop iterations execute.
212208
// This makes behavior consistent with the parallel compiler.
213209
let mut panic = None;
@@ -397,9 +393,7 @@ cfg_if! {
397393

398394
pub fn par_for_each_in<T: IntoParallelIterator>(
399395
t: T,
400-
for_each: impl Fn(
401-
<<T as IntoParallelIterator>::Iter as ParallelIterator>::Item
402-
) + Sync + Send
396+
for_each: impl Fn(T::Item) + Sync + Send,
403397
) {
404398
t.into_par_iter().for_each(for_each)
405399
}

0 commit comments

Comments
 (0)