std_macro_extensions/execute/
macro.rs

1/// Invoke a function with a primary array argument and optional additional arguments.
2///
3/// # Parameters
4/// - `path`: The path to the function to invoke.
5/// - `array`: The primary argument, typically a slice or vector.
6/// - `arg`: (Optional) Additional arguments passed to the function.
7///
8/// # Returns
9/// - The return value of the invoked function.
10#[macro_export]
11macro_rules! execute {
12    ($path: path, $array: expr) => {
13        $path($array)
14    };
15    ($path: path, $array: expr, $($arg: expr), *) => {
16        $path($array, $($arg), *)
17    };
18}