-
Notifications
You must be signed in to change notification settings - Fork 145
RUST-1748 Refactor BSON DateTime serde converters using serde_conv_doc macro #570
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
RUST-1748 Refactor BSON DateTime serde converters using serde_conv_doc macro #570
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I request waiting on @isabelatkinson or @abr-egn to review before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, just one minor comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
a_deserialized.date_optional_none, None, | ||
"Expected deserialized date_optional_none to be None." | ||
); | ||
#[serde_as] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reordered tests based on definitions in serde_helpers.rs
Refactor all BSON
DateTime
serde helpers to useserde_conv_doc
cargo doc
command withRUSTDOCFLAGS="--cfg docsrs"
:RUSTDOCFLAGS="--cfg docsrs" cargo doc --open
bson_datetime_as_rfc3339_string
datetime::AsRfc3339String
(DateTime → u32)rfc3339_string_as_bson_datetime
datetime::FromRfc3339String
(String → DateTime)chrono_datetime_as_bson_datetime
datetime::FromChrono04DateTime
(chrono::DateTime → DateTime)i64_as_bson_datetime
datetime::FromI64
(i64 → DateTime)time_0_3_offsetdatetime_as_bson_datetimetime-0_3
datetime::FromTime03OffsetDateTime
(time::OffsetDateTime→ DateTime)Previously:
SerializeAs
andDeserializeAs
traits to support Optional and Vector conversions in PR #559serde_conv
macro in PR #566