"better" fmt

This commit is contained in:
nora 2022-09-14 22:55:45 +02:00
parent 443d5385df
commit bded715627

View file

@ -124,23 +124,13 @@ macro_rules! options {
} }
options!( options!(
fn alternate(&self) -> bool { fn alternate(&self) -> bool { false }
false struct WithAlternate { true }
}
struct WithAlternate {
true
}
fn width(&self) -> Option<usize> { fn width(&self) -> Option<usize> { None }
None struct WithWidth<const A: usize> { Some(A) }
}
struct WithWidth<const A: usize> {
Some(A)
}
fn align(&self) -> Alignment { fn align(&self) -> Alignment { Alignment::Unknown }
Alignment::Unknown
}
struct WithAlign<const A: usize> { struct WithAlign<const A: usize> {
match A { match A {
0 => Alignment::Unknown, 0 => Alignment::Unknown,
@ -151,53 +141,24 @@ options!(
} }
} }
fn fill(&self) -> char { ' ' }
struct WithFill<const A: char> { A }
fn fill(&self) -> char { fn sign_plus(&self) -> bool { false }
' ' struct WithSignPlus { true }
}
struct WithFill<const A: char> {
A
}
fn sign_plus(&self) -> bool { fn sign_aware_zero_pad(&self) -> bool { false }
false struct WithSignAwareZeroPad { true }
}
struct WithSignPlus {
true
}
fn sign_aware_zero_pad(&self) -> bool { fn sign_minus(&self) -> bool { false }
false struct WithMinus { true }
}
struct WithSignAwareZeroPad {
true
}
fn sign_minus(&self) -> bool { fn precision(&self) -> Option<usize> { None }
false struct WithPrecision<const A: usize> { Some(A) }
}
struct WithMinus {
true
}
fn precision(&self) -> Option<usize> { fn debug_lower_hex(&self) -> bool { false }
None struct WithDebugLowerHex { true }
}
struct WithPrecision<const A: usize> {
Some(A)
}
fn debug_lower_hex(&self) -> bool { fn debug_upper_hex(&self) -> bool { false }
false struct WithDebugUpperHex { false }
}
struct WithDebugLowerHex {
true
}
fn debug_upper_hex(&self) -> bool {
false
}
struct WithDebugUpperHex {
false
}
); );