forked from mongodb/bson-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
RUST-1748 Convert unsigned serde helpers to use serde_conv #2
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
Closed
Conversation
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
4e4291e to
1db7343
Compare
JamieTsai1024
commented
Jul 14, 2025
src/tests/serde.rs
Outdated
| #[test] | ||
| fn test_unsigned_helpers() { | ||
| #[cfg(feature = "serde_with-3")] | ||
| fn test_oid_helpers() { |
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.
moved oid tests to match order of structs in serde_helpers.rs
JamieTsai1024
commented
Jul 14, 2025
| } | ||
|
|
||
| #[test] | ||
| fn test_unsigned_helpers() { |
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.
new unsigned tests replaces this test
…1024/bson-rust into RUST-1748-serde_conv-3
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.
This PR was split into smaller PRs for review by unsigned (
u32,u64), ObjectId (object_id), and UUID (uuid_1)Original PR:
Converted unsigned (
u32,u64) and UUID (uuid_1) converter functions insrc/serde_helpers.rsto useserde_convmacro for serializing and deserializing optional and vector fields withserde_with.<T>,Option<T>, andVec<T>fields (de)serialized using structsserde_helpers*_optional_somestructstimestamp_as_u32u32::FromTimestamp(Timestamp → u32)u32_as_timestampu32::AsTimestamp(u32 → Timestamp)u32_as_f64u32::AsF64(u32 → f64)serialize_u32_as_i32u32::AsI32(u32 → i32)serialize_u32_as_i64u32::AsI64(u32 → i64)u64_as_f64u64::AsF64(u64 → f64)serialize_u64_as_i32u64::AsI32(u64 → i32)serialize_u64_as_i64u64::AsI64(u64 → i64)uuid_1_as_binaryuuid_1::AsBinary(UUID → Binary)uuid_1_as_c_sharp_legacy_binaryuuid_1::AsCSharpLegacyBinary(UUID → Binary in the legacy C# driver UUID format)uuid_1_as_java_legacy_binaryuuid_1::AsJavaLegacyBinary(UUID → Binary in the legacy Java driver UUID format)uuid_1_as_python_legacy_binaryuuid_1::AsPythonLegacyBinary(UUID → Binary in the legacy Python driver UUID format)Previously:
SerializeAsandDeserializeAstraits to support Optional and Vector conversions in PR #559serde_convmacro to support Rustdocs, refactored allObjectIdconverters in PR #566DateTimeconverters PR #570