Skip to content
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

Fix bugs in timestamp #452

Merged
merged 1 commit into from
Dec 19, 2022
Merged

Fix bugs in timestamp #452

merged 1 commit into from
Dec 19, 2022

Conversation

popematt
Copy link
Contributor

  • Fix incorrect handling of positive mantissa in fractional seconds for a zero coefficient
  • Removes some panics in favor of returning Result::Err

Issue #, if available:

None

Description of changes:

While working on fixing up ion-hash for the next ion-rs release, I discovered some minor issues in the timestamp implementation. This PR fixes them.

  • TimestampBuilder will now set fractional seconds to None if the fractional seconds coefficient is 0 and the exponent is > -1.
  • Added test case for the above change
  • Two panics are replaced by returning an EncodingError
  • Added encoding_error functions that mirror the existing decoding_error functions.
  • Nightly build for the coverage workflow needed to be updated because the prior nightly build was panicking for my changes (even though stable build worked fine).

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

* Fix incorrect handling of positive mantissa in fractional seconds for a zero coefficient
* Removes some panics in favor of returning Result::Err
@popematt popematt merged commit 87fc57a into amazon-ion:main Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants