Conversation
|
Related questions:
My motivation: what I actually want is to represent the last time something happened, if any. |
|
Thanks! Seems reasonable to have such a feature.
Given that these types already have some associated constants, associated constants may be more consistent. That said, I have no strong opinion on this.
It is interesting that associated constants are less flexible than const fns, but I'm not too worried about this as we can define an associated constant using a private const fn.
The first purpose of this crate was to use
Sorry, I'm not sure what you mean. The current |
Both types have an But in that case, I guess this crate is redundant since rust-lang/rust#89926 ? |
|
dtolnay/request-for-implementation#27 and rust-lang/rust#58395 are the context of this crate. I agree that (EDIT: To clarify, I'm not negative at all about the other use cases. I'm just concerned about a potential pitfall of the API for known use cases.)
Well, that PR fixes the most annoying problem, but they are not the only operations that cause panic. |
|
Updated. I probably won't end up using this library myself, so leave it to you to decide what to do with this. |
|
Build succeeded: |
|
Published in 0.2.3. |
Both
DurationandInstantare explicitly optional types, so why not add this?Alternative: add
NONEas an associated constant. Simpler, but less flexible in case the internal representation changes.Workaround: both support
From<Option<..>>already.