mirror of
https://github.com/Noratrieb/mono-fmt.git
synced 2026-01-14 15:25:08 +01:00
fixes
This commit is contained in:
parent
5a6f2e5130
commit
a90c1bf054
1 changed files with 24 additions and 25 deletions
11
src/args.rs
11
src/args.rs
|
|
@ -21,7 +21,6 @@ macro_rules! tuple_args {
|
|||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
tuple_args!($($rest)*);
|
||||
};
|
||||
}
|
||||
|
|
@ -49,15 +48,15 @@ impl Arguments for Str {
|
|||
}
|
||||
|
||||
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 {
|
||||
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 {
|
||||
let mut f = f.wrap_with(&self.1);
|
||||
|
||||
|
|
@ -84,11 +83,11 @@ macro_rules! traits {
|
|||
)*
|
||||
|
||||
pub mod macro_exports {
|
||||
pub use super::{$($name, $trait),*};
|
||||
pub use super::{$($arg_name, $trait),*};
|
||||
}
|
||||
|
||||
pub mod pub_exports {
|
||||
pub use super::{$($name, $trait),*};
|
||||
pub use super::{$($trait),*};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue