pub(crate) fn run_maybe_parallel<
        A: Send,
        B: Send,
        E: Send,
        F: Fn(A) -> Result<B, E> + Send + Sync,
    >(
        &self,
        input: Vec<A>,
        f: F,
    ) -> Result<Vec<B>, E> {
        if self.parallel_compilation {
            #[cfg(feature = "parallel-compilation")]
            return input
                .into_par_iter()
                .map(|a| f(a))
                .collect::<Result<Vec<B>, E>>();
        }

        // In case the parallel-compilation feature is disabled or the parallel_compilation config
        // was turned off dynamically fallback to the non-parallel version.
        input
            .into_iter()
            .map(|a| f(a))
            .collect::<Result<Vec<B>, E>>()
    }
/// Run the given closure in parallel if the compiler is configured to do so.
Run the given closure in parallel if the compiler is configured to do so.
Run the given closure in parallel if the compiler is configured to do so .
pub(crate) fn run_maybe_parallel<
        A: Send,
        B: Send,
        E: Send,
        F: Fn(A) -> Result<B, E> + Send + Sync,
    >(
        &self,
        input: Vec<A>,
        f: F,
    ) -> Result<Vec<B>, E> {
        if self.parallel_compilation {
            #[cfg(feature = "parallel-compilation")]
            return input
                .into_par_iter()
                .map(|a| f(a))
                .collect::<Result<Vec<B>, E>>();
        }
        // In case the parallel-compilation feature is disabled or the parallel_compilation config
        // was turned off dynamically fallback to the non-parallel version.
        input
            .into_iter()
            .map(|a| f(a))
            .collect::<Result<Vec<B>, E>>()
    }
pub ( crate ) fn run_maybe_parallel < A : Send , B : Send , E : Send , F : Fn ( A ) -> Result < B , E > + Send + Sync , > ( & self , input : Vec < A > , f : F , ) -> Result < Vec < B > , E > { if self . parallel_compilation { # [ cfg ( feature " " ) ] return input . into_par_iter ( ) . map ( | a | f ( a ) ) . collect :: < Result < Vec < B > , E > > ( ) ; } // In case the parallel-compilation feature is disabled or the parallel_compilation config // was turned off dynamically fallback to the non-parallel version. input . into_iter ( ) . map ( | a | f ( a ) ) . collect :: < Result < Vec < B > , E > > ( ) }
Run the given closure in parallel if the compiler is configured to do so.
Run the given closure in parallel if the compiler is configured to do so .
&self
input
Vec<A>
f
F
&self
input
Vec<A>
f
F