-
Notifications
You must be signed in to change notification settings - Fork 176
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
FixedDecimal *ed
methods should be infallible
#4857
Comments
For the datetime use case, I think it would be useful to have a |
I don't think it solves the overlap issue. |
I think it does. It would use |
Hmm, that's quite clever. How does it handle these cases though?
|
I wouldn't be opposed to implementing a |
Fixes #4857 I think that's the only `fn *ed* -> Result` that we have. <!-- Thank you for your pull request to ICU4X! Reminder: try to use [Conventional Comments](https://conventionalcomments.org/) to make comments clearer. Please see https://github.com/unicode-org/icu4x/blob/main/CONTRIBUTING.md for general information on contributing to ICU4X. -->
This function is misleading:
In the error case, it returns
other
, but it still throws awayself
. It should probably return a tuple containing both FixedDecimals. It makes it tempting to write code such asmantissa.concatenated_end(fraction).unwrap_or_else(|fd| fd)
, which is wrong because it promotesfraction
when it should probably keepmantissa
and throw awayfraction
.I think we should delete this function since it is only sugar over
concatenate_end
, which is harder to use incorrectly.The text was updated successfully, but these errors were encountered: