diff --git a/src/core/executor.rs b/src/core/executor.rs index 2fe47555a..f8540eb9e 100644 --- a/src/core/executor.rs +++ b/src/core/executor.rs @@ -41,16 +41,12 @@ impl Executor { /// /// Regardless of the executor (`SingleThread` or `ThreadPool`), panics in the task /// will propagate to the caller. - pub fn map< + pub fn map(&self, f: F, args: impl Iterator) -> crate::Result> + where A: Send, R: Send, - AIterator: Iterator, F: Sized + Sync + Fn(A) -> crate::Result, - >( - &self, - f: F, - args: AIterator, - ) -> crate::Result> { + { match self { Executor::SingleThread => args.map(f).collect::>(), Executor::ThreadPool(pool) => {