otp_std/
macros.rs

1//! Various macros used by this crate.
2
3macro_rules! errors {
4    (
5        Type = $type: ty,
6        Hack = $hack: tt,
7        $(
8            $name: ident => $method: ident (
9                $(
10                    $variable_name: ident $(=> $prepare: ident)?
11                ),*
12                $(,)?
13            )
14        ),*
15        $(,)?
16    ) => {
17        $(
18            macro_rules! $name {
19                (
20                    $(
21                        $hack $variable_name: expr
22                    ),*
23                ) => {
24                    <$type>::$method(
25                        $(
26                            $hack $variable_name$(.$prepare())?
27                        ),*
28                    )
29                }
30            }
31        )*
32    };
33}
34
35pub(crate) use errors;