mirror of
https://github.com/Noratrieb/mono-fmt.git
synced 2026-01-16 00:05:05 +01:00
wow cool $crate hack thank you nemo
This commit is contained in:
parent
20befd0a8f
commit
5b22878e81
3 changed files with 49 additions and 29 deletions
|
|
@ -50,17 +50,17 @@ impl Arguments for Str {
|
|||
}
|
||||
}
|
||||
|
||||
pub struct DebugArg<T>(pub T);
|
||||
pub struct DebugArg<T, O>(pub T, pub PhantomData<O>);
|
||||
|
||||
impl<T: Debug> Arguments for DebugArg<T> {
|
||||
impl<T: Debug, OutOpt> Arguments for DebugArg<T, OutOpt> {
|
||||
fn fmt<W: Write, O: FmtOpts>(&self, f: &mut Formatter<W, O>) -> Result {
|
||||
Debug::fmt(&self.0, f)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct DisplayArg<T>(pub T);
|
||||
pub struct DisplayArg<T, O>(pub T, pub PhantomData<O>);
|
||||
|
||||
impl<T: Display> Arguments for DisplayArg<T> {
|
||||
impl<T: Display, OutOpt> Arguments for DisplayArg<T, OutOpt> {
|
||||
fn fmt<W: Write, O: FmtOpts>(&self, f: &mut Formatter<W, O>) -> Result {
|
||||
Display::fmt(&self.0, f)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue