Skip to content

Add short display formats (Format::IECShort / Format::SIShort)#13

Merged
lthiery merged 1 commit into
mainfrom
short-formats
Jul 7, 2026
Merged

Add short display formats (Format::IECShort / Format::SIShort)#13
lthiery merged 1 commit into
mainfrom
short-formats

Conversation

@lthiery

@lthiery lthiery commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Format is now #[non_exhaustive] and gained variants — technically breaking for exhaustive matches, hence 0.4.0 rather than 0.3.1. Long-format output is byte-for-byte unchanged (tests assert this).

Documented footgun: parse() interprets bare M as decimal, so short IEC output doesn't round-trip exactly — noted on the variant doc pointing users at Format::IEC for values that get parsed back.

Compact style matching bytesize's iec_short/si_short: no space, no
iB/B suffix ("11.8M", "215B"); output is sort -h compatible. Format
is now #[non_exhaustive]; adding variants is why this is 0.4.0.

Motivated by pitchfork's TUI, which hand-rolls this style in three
places.
@lthiery lthiery merged commit 8267eea into main Jul 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant