Open rmarrowstone opened 2 years ago
An observation is that the TimestampBuilder
could be refactored to take the components of the Decimal
for fractional seconds. This would preserve the invariants such that the Text parser and DOM instantiation code couldn't get a runtime error. The binary parser is where the invariants needs to be checked at runtime, but we can put the checks there on the raw values that make up the Decimal
.
The methods mentioned are not public, so I don't think this needs to block 1.0.
There are two crate-visible functions in Decimal and Coefficient that are used for timestamps.
To support that there are two functions which work fine for their current purposes but have surprising semantics on their own:
Coefficient::number_of_decimal_digits()
does not consider the signDecimal::is_greater_than_or_equal_to_one()
returnstrue
forn <= -1