-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OffsetResult
should be a specialization of Result
#21
Comments
Why is it non-idiomatic? Could you explain a bit more? As for why I've chosen not to use a
I'm not sure that would be more ergonomic than the current definition. Using a standard Result type would be a breaking change and would be more restrictive with what facility is allowed to be implemented. Could you develop on what makes the current |
An ambiguous offset is arguably abnormal too: there is no way to proceed without deciding on which of the possible times to use. There are a lot of APIs which provide recovery information in the error type of
Fair point. So this is more of a wishlist item for 3.0, then. |
Can you try the version on |
Looks good; I have provided some comments. The |
I've seen that, for one of them it's out of date as the auto format pass in the CI workflow fixed it. About the naming consistency issue, I have no idea how to fix it without having either inconsistent names related to what the function does or impossibility to call one of the functions due to name conflict.
EDIT: I've published a new release candidate (5.0.0) which should improve APIs with a better name for map_all. |
Yeah;
I thought, too, that there should be a more domain-specific name for the extension method on |
I'm not sure about |
So it's like
|
EDIT: note that in some of my projects I may end up mapping OffsetDateTime into another a PrimitiveDateTime or even into another OffsetDateTime, which is why I say "usually" as it's not always the case. |
It's unfortunate that
OffsetResult
was copied fromchrono
'sLocalResult
, as that is non-idiomatic.I think it should be more ergonomically defined as
type OffsetResult<T> = Result<T, OffsetError<T>>;
, withOffsetError
taking the error cases. You can add utility methods to this specialization ofResult
with extension traits (which could be re-exported in aprelude
mod).The text was updated successfully, but these errors were encountered: