digits

Function digits 

Source
fn digits(n: u64) -> u8
Expand description

Returns the number of digits in the decimal representation of n.

This calculation to figure out the number of digits to write in n is the expense we incur by having our printers write forwards. If we instead wrote backwards, then we could omit this calculation. I ended up choosing this design because 1) most integer writes in datetime (not span) printing are fixed 2 or 4 digits, and don’t require this extra computation and 2) writing backwards just overall seems like a pain.