1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#[macro_export(local_inner_macros)]
macro_rules! run_par {
    (
        $func:expr
    ) => {{
        #[cfg(feature = "std")]
        use rayon::prelude::*;

        #[cfg(feature = "std")]
        let output = rayon::scope(|_| $func());

        #[cfg(not(feature = "std"))]
        let output = $func();

        output
    }};
}

#[macro_export(local_inner_macros)]
macro_rules! iter_par {
    (
        $start:expr, $end:expr
    ) => {{
        #[cfg(feature = "std")]
        let output = ($start..$end).into_par_iter();

        #[cfg(not(feature = "std"))]
        let output = ($start..$end);

        output
    }};
}