Re:Jiff: A brand new Datetime library for Rust, from the aut...
by Tobu on Tuesday July 23, 2024 @05:12AM
(#41044135)
The Into<SpanArithmetic> argument feels a little too magical.
Since you are not constrained by a trait, I would prefer something like
Span::add_with_reference(&self, other: &Span, reference: impl Into<SpanRelativeTo>)
In contrast, component wise addition would lead to a span of `1 year 14 months`. Which is a valid `Span`. Jiff is fine with it. But it's different than what `checked_add` does. Having both operations seems too subtle.
Also, I don't really think using the `+` operator just to construct spans is that much of a win over what Jiff already has. So that needs to be taken into account as well.