Similar to what was mentioned in a previous post Pre-RFC: Custom suffixes for integer and float literals I'd like to propose time suffixes for numeric literals, this time only for the Duration
type. It would feel very natural and easy to read a duration like 1s
, 10ms
, 1_000_ns
and so on. Duration
being on core feels suitable to gain this syntactic sugar similar to other numeric primitives.
With this recent post about IntoFuture
and its example about a possible future implementation of IntoFuture
for Duration
I thought it would be very handy to write something like (1_min + 30_sec + 11_ms).await;