ion-rust icon indicating copy to clipboard operation
ion-rust copied to clipboard

Change type of `Timestamp::fractional_seconds` to be `Mantissa`

Open desaikd opened this issue 3 years ago • 2 comments

Current implementation of Timestamp has fractional_seconds type as Option<Mantissa>.

https://github.com/amzn/ion-rust/blob/944511591310f7e273074eaa252f6cd37b5728bb/src/types/timestamp.rs#L126-L131

The above could be simplified by making type of fractional_seconds as Mantissa when creating the Timestamp. We can put a default value for fractional_seconds which could either be Mantissa::Digits(0) or Mantissa::Decimal(Decimal::new(0,0)).

Reference PR: https://github.com/amzn/ion-rust/pull/410

desaikd avatar Sep 01 '22 20:09 desaikd

This is an implementation detail; I don't believe it needs to block the 1.0 release. Thoughts, @popematt?

zslayton avatar Jul 05 '23 19:07 zslayton

Now that I've looked a little closer, I think you're right.

popematt avatar Jul 05 '23 20:07 popematt