1 // not all are used in all features configurations
2 #![allow(unused)]
3 
4 /// Forward a method to an inherent method or a base trait method.
5 macro_rules! forward {
6     ($( Self :: $method:ident ( self $( , $arg:ident : $ty:ty )* ) -> $ret:ty ; )*)
7         => {$(
8             #[inline]
9             fn $method(self $( , $arg : $ty )* ) -> $ret {
10                 Self::$method(self $( , $arg )* )
11             }
12         )*};
13     ($( $base:ident :: $method:ident ( self $( , $arg:ident : $ty:ty )* ) -> $ret:ty ; )*)
14         => {$(
15             #[inline]
16             fn $method(self $( , $arg : $ty )* ) -> $ret {
17                 <Self as $base>::$method(self $( , $arg )* )
18             }
19         )*};
20     ($( $base:ident :: $method:ident ( $( $arg:ident : $ty:ty ),* ) -> $ret:ty ; )*)
21         => {$(
22             #[inline]
23             fn $method( $( $arg : $ty ),* ) -> $ret {
24                 <Self as $base>::$method( $( $arg ),* )
25             }
26         )*}
27 }
28 
29 macro_rules! constant {
30     ($( $method:ident () -> $ret:expr ; )*)
31         => {$(
32             #[inline]
33             fn $method() -> Self {
34                 $ret
35             }
36         )*};
37 }
38