BurntSushi / jiff

A date-time library for Rust that encourages you to jump into the pit of success.
The Unlicense
1.74k stars 33 forks source link

fmt: simplify integer formatting slightly #126

Closed BurntSushi closed 1 month ago

BurntSushi commented 1 month ago

It turns out that "no padding set" and "padding is zero" result in the same behavior. I think this might have been different back when I was (ab)using the integer formatting to also do fractional formatting. But either way, eliminating a redundant internal state is a win.

I discovered this while wondering whether I could unconditionally set the padding to 0 and if it would be the same as not setting it.