Skip to content
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-1681 Add deserialize_object_id_from_hex_string #421

Closed
wants to merge 1 commit into from

Conversation

sunsided
Copy link

@sunsided sunsided commented Jul 6, 2023

This implements RUST-1681 bson::serde_helpers::deserialize_object_id_from_hex_string (#418).

I rearranged the already existing serialize_object_id_as_hex_string function into a object_id_as_hex_string module similar to the way hex_string_as_object_id was implemented.

@abr-egn
Copy link
Contributor

abr-egn commented Jul 10, 2023

Thank you for the contribution! This looks excellent, I've authorized the evergreen run and once that comes back green I'll merge this in 🙂

@abr-egn abr-egn self-assigned this Jul 10, 2023
@abr-egn
Copy link
Contributor

abr-egn commented Jul 10, 2023

It looks like there are a few clippy and rustfmt errors:

[2023/07/10 16:09:35.146] error: unused import: `Serialize`
[2023/07/10 16:09:35.146]  --> src/serde_helpers.rs:5:18
[2023/07/10 16:09:35.146]   |
[2023/07/10 16:09:35.146] 5 | use serde::{ser, Serialize, Serializer};
[2023/07/10 16:09:35.146]   |                  ^^^^^^^^^
[2023/07/10 16:09:35.146]   |
[2023/07/10 16:09:35.146]   = note: `-D unused-imports` implied by `-D warnings`
[2023/07/10 16:09:35.146] error: unused import: `crate::oid::ObjectId`
[2023/07/10 16:09:35.146]  --> src/serde_helpers.rs:7:5
[2023/07/10 16:09:35.146]   |
[2023/07/10 16:09:35.146] 7 | use crate::oid::ObjectId;
[2023/07/10 16:09:35.146]   |     ^^^^^^^^^^^^^^^^^^^^
[2023/07/10 16:08:32.329] Diff in /data/mci/0bb5ee567d6e491fa6826df19cb4fd7e/src/src/serde_helpers.rs at line 23:
[2023/07/10 16:08:32.329]      serialize as serialize_hex_string_as_object_id,
[2023/07/10 16:08:32.329]  };
[2023/07/10 16:08:32.329]  #[doc(inline)]
[2023/07/10 16:08:32.330] -pub use object_id_as_hex_string::{
[2023/07/10 16:08:32.330] -    deserialize as deserialize_object_id_from_hex_string,
[2023/07/10 16:08:32.330] -    serialize as serialize_object_id_as_hex_string,
[2023/07/10 16:08:32.330] -};
[2023/07/10 16:08:32.330] -#[doc(inline)]
[2023/07/10 16:08:32.330]  pub use i64_as_bson_datetime::{
[2023/07/10 16:08:32.330]      deserialize as deserialize_i64_from_bson_datetime,
[2023/07/10 16:08:32.330]      serialize as serialize_i64_as_bson_datetime,
[2023/07/10 16:08:32.330] Diff in /data/mci/0bb5ee567d6e491fa6826df19cb4fd7e/src/src/serde_helpers.rs at line 34:
[2023/07/10 16:08:32.330] +};
[2023/07/10 16:08:32.330] +#[doc(inline)]
[2023/07/10 16:08:32.330] +pub use object_id_as_hex_string::{
[2023/07/10 16:08:32.330] +    deserialize as deserialize_object_id_from_hex_string,
[2023/07/10 16:08:32.330] +    serialize as serialize_object_id_as_hex_string,
[2023/07/10 16:08:32.330]  };
[2023/07/10 16:08:32.330]  #[doc(inline)]
[2023/07/10 16:08:32.330]  pub use rfc3339_string_as_bson_datetime::{

Once those are fixed it'll be good to merge!

@abr-egn
Copy link
Contributor

abr-egn commented Jul 10, 2023

Again, we appreciate the contribution, but it turns out that this isn't actually needed :)

@abr-egn abr-egn closed this Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants