Skip to content

RUST-1748 Convert serde helpers to serde_with::(De)SerializeAs implementations #559

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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

JamieTsai1024
Copy link

No description provided.

@JamieTsai1024 JamieTsai1024 marked this pull request as ready for review June 25, 2025 17:33
@JamieTsai1024 JamieTsai1024 requested a review from a team as a code owner June 25, 2025 17:33
@JamieTsai1024 JamieTsai1024 requested a review from abr-egn June 25, 2025 17:33
@isabelatkinson isabelatkinson requested review from isabelatkinson and removed request for abr-egn June 25, 2025 17:35
Comment on lines 804 to 812
for element in date_vector {
match element {
bson::Bson::String(value) => assert_eq!(
value, iso,
"Expected each element in date_vector to match original.",
),
_ => panic!("Expected all elements in date_vector to be a BSON DateTime."),
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be assert_eq!(date_vector, a.date_vector) instead?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to find a cleaner version of using assert_eq and this is the best I could come up with - it just has less detailed error messages. Do you have any feedback on this before I use it for the other tests?

let date_vector = doc
    .get_array("date_vector")
    .expect("Expected serialized date_vector to be a BSON array.");
let expected_date_vector: Vec<Bson> = a
    .date_vector
    .iter()
    .map(|dt| Bson::String(dt.try_to_rfc3339_string().unwrap()))
    .collect();
assert_eq!(date_vector, &expected_date_vector);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants