mirror of
https://github.com/Noratrieb/mono-fmt.git
synced 2026-01-14 15:25:08 +01:00
"better" fmt
This commit is contained in:
parent
443d5385df
commit
bded715627
1 changed files with 19 additions and 58 deletions
77
src/opts.rs
77
src/opts.rs
|
|
@ -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
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue