Repository navigation
Conversation
Signed-off-by: Bailey Hayes <bailey@cosmonic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #162.
Replace
chronowithtimeforpbjson-types::Timestampconversions and JSON serialization.time::OffsetDateTimesupports the full Protobuf timestamp range, including9999-12-31T23:59:59.999999999Z. Disable its default features and enable formatting, parsing, and format-description macros; no local timezone lookup is needed.This is a breaking Rust API change: the conversion impls now use
time::OffsetDateTimein place ofchrono::DateTime<Utc>. The existing JSON output stays the same, including+00:00and 0/3/6/9 fractional digits. Update the test workspace's native timestamp fixture and document the replacement conversion API.Validate the Protobuf seconds range and nonnegative nanoseconds before serialization and after parsing offset timestamps. Regression tests cover both endpoints, fractional precision, normalized offsets before 1970, invalid fields, and offsets that would move an otherwise valid local date outside the Protobuf range. The workspace dependency tree contains no
chrono.Validated with the repository's Rust 1.91 toolchain:
cargo test --workspace, including the conversion doctest.ignore-unknown-fields,btree,emit-fields,use-integers-for-enums,preserve-proto-field-names, andignore-unknown-enum-variants.cargo clippy --all-targets --workspace -- -D warnings.cargo fmt --all -- --check.cargo doc --document-private-items --no-deps --workspace.