This commit is contained in:
nora 2022-09-25 12:54:22 +02:00
parent 5a6f2e5130
commit a90c1bf054

View file

@ -21,7 +21,6 @@ macro_rules! tuple_args {
Ok(()) Ok(())
} }
} }
tuple_args!($($rest)*); tuple_args!($($rest)*);
}; };
} }
@ -49,15 +48,15 @@ impl Arguments for Str {
} }
macro_rules! traits { macro_rules! traits {
($($(#[$no_reference_blanket_impl:ident])? struct $name:ident: trait $trait:ident);* $(;)?) => { ($($(#[$no_reference_blanket_impl:ident])? struct $arg_name:ident: trait $trait:ident);* $(;)?) => {
$( $(
pub struct $name<T, O>(pub T, pub O); pub struct $arg_name<T, O>(pub T, pub O);
pub trait $trait { pub trait $trait {
fn fmt<W: Write, O: FmtOpts>(&self, f: &mut Formatter<W, O>) -> Result; fn fmt<W: Write, O: FmtOpts>(&self, f: &mut Formatter<W, O>) -> Result;
} }
impl<T: $trait, O: FmtOpts> Arguments for $name<T, O> { impl<T: $trait, O: FmtOpts> Arguments for $arg_name<T, O> {
fn fmt<W: Write, OldOpts: FmtOpts>(&self, f: &mut Formatter<W, OldOpts>) -> Result { fn fmt<W: Write, OldOpts: FmtOpts>(&self, f: &mut Formatter<W, OldOpts>) -> Result {
let mut f = f.wrap_with(&self.1); let mut f = f.wrap_with(&self.1);
@ -84,11 +83,11 @@ macro_rules! traits {
)* )*
pub mod macro_exports { pub mod macro_exports {
pub use super::{$($name, $trait),*}; pub use super::{$($arg_name, $trait),*};
} }
pub mod pub_exports { pub mod pub_exports {
pub use super::{$($name, $trait),*}; pub use super::{$($trait),*};
} }
}; };
} }