macro_rules! forward {
($(fn $method:ident ( self $( , $arg:ident : $ty:ty )* ) -> $ret:ty ; )*) => {$(
#[doc = forward_doc!($method)]
#[inline]
fn $method(self $( , $arg : $ty )* ) -> $ret {
Self::$method(self $( , $arg )* )
}
)*};
($(fn $method:ident ( &self $( , $arg:ident : $ty:ty )* ) -> $ret:ty ; )*) => {$(
#[doc = forward_doc!($method)]
#[inline]
fn $method(&self $( , $arg : $ty )* ) -> $ret {
Self::$method(self $( , $arg )* )
}
)*};
($(fn $method:ident ( $( $arg:ident : $ty:ty ),* ) -> $ret:ty ; )*) => {$(
#[doc = forward_doc!($method)]
#[inline]
fn $method($( $arg : $ty ),* ) -> $ret {
Self::$method($( $arg ),* )
}
)*};
($(unsafe fn $method:ident ( self $( , $arg:ident : $ty:ty )* ) -> $ret:ty ; )*) => {$(
#[doc = forward_doc!($method)]
#[inline]
unsafe fn $method(self $( , $arg : $ty )* ) -> $ret {
unsafe { Self::$method(self $( , $arg )* ) }
}
)*};
}
macro_rules! forward_doc {
($method:ident) => {
concat!(
"See the inherent [`",
stringify!($method),
"`][Self::",
stringify!($method),
"] method."
)
};
}
macro_rules! use_consts {
(Self :: { $( $name:ident : $ty:ty ,)+ }) => {
$(
#[doc = concat!(
"See the inherent [`", stringify!($name), "`][",
"Self::", stringify!($name), "] constant."
)]
const $name: $ty = Self:: $name;
)+
};
($base:ident :: { $( $name:ident : $ty:ty ,)+ }) => {
$(
#[doc = concat!(
"See the standard library [`", stringify!($name), "`][",
stringify!($base), "::", stringify!($name), "] constant."
)]
const $name: $ty = $base :: $name;
)+
};
}