diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-02-27 14:38:09 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-27 14:38:09 +0900 |
| commit | 7824a9d47df8aea31b0cc694c70b654a8090f411 (patch) | |
| tree | a1d17b19b9e6967b7c7ae3f2f35174b019e47fd3 | |
| parent | 6e66bfd4cc168a59e1c81f3b26105a8e41fa1c36 (diff) | |
| parent | 3d47ebeb0e96e328f247cb691f376e6431f258aa (diff) | |
| download | rust-7824a9d47df8aea31b0cc694c70b654a8090f411.tar.gz rust-7824a9d47df8aea31b0cc694c70b654a8090f411.zip | |
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.
| -rw-r--r-- | src/librustc_data_structures/sync.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/librustc_data_structures/sync.rs b/src/librustc_data_structures/sync.rs index fa98b4d72dd..9051b1751b1 100644 --- a/src/librustc_data_structures/sync.rs +++ b/src/librustc_data_structures/sync.rs @@ -203,11 +203,7 @@ cfg_if! { t.into_iter() } - pub fn par_for_each_in<T: IntoIterator>( - t: T, - for_each: - impl Fn(<<T as IntoIterator>::IntoIter as Iterator>::Item) + Sync + Send - ) { + pub fn par_for_each_in<T: IntoIterator>(t: T, for_each: impl Fn(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; @@ -397,9 +393,7 @@ cfg_if! { pub fn par_for_each_in<T: IntoParallelIterator>( t: T, - for_each: impl Fn( - <<T as IntoParallelIterator>::Iter as ParallelIterator>::Item - ) + Sync + Send + for_each: impl Fn(T::Item) + Sync + Send, ) { t.into_par_iter().for_each(for_each) } |
