Re: [PATCH v2] rust: time: implement `Display` for `Delta`
From: FUJITA Tomonori
Date: Wed Nov 04 2026 - 04:10:25 EST
On Tue, 03 Nov 2026 16:23:40 +0100
Andreas Hindborg <a.hindborg@xxxxxxxxxx> wrote:
> Implement the `Display` trait for `Delta` so that it can be displayed by a
> formatter.
[...]
> - Drop the `rnull` user, which will call `Delta::as_nanos` instead (Gary).
Now that the rnull user has been dropped, I wonder if we need this
now.
If we want a readable format with a unit, Debug might be a better fit.
core::time::Duration implements only Debug, not Display, and its Debug
output includes the unit (e.g. 1.5s). Debug output is not expected to
be stable, so we could change the format later. Users that need a
fixed format can use as_nanos(), like rnull does.
What do you think?