#[doc(hidden)]
#[macro_export]
macro_rules! impl_deref {
($ident:ident) => {
impl<T> ::core::ops::Deref for $ident<T> {
type Target = T;
#[inline]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<T> ::core::ops::DerefMut for $ident<T> {
#[inline]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
};
($ident:ident : $ty:ty) => {
impl ::core::ops::Deref for $ident {
type Target = $ty;
#[inline]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl ::core::ops::DerefMut for $ident {
#[inline]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
};
}
#[doc(hidden)]
#[macro_export]
macro_rules! impl_display {
($ty:ty) => {
impl ::core::fmt::Display for $ty {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
::core::fmt::Display::fmt(&self.0, f)
}
}
};
}