Skip to content

RUST-1540 Rename i64_as_datetime to i64_as_bson_datetime #393

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

Merged
merged 1 commit into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/serde_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ pub use hex_string_as_object_id::{
serialize as serialize_hex_string_as_object_id,
};
#[doc(inline)]
pub use i64_as_datetime::{
deserialize as deserialize_i64_from_datetime,
serialize as serialize_i64_as_datetime,
pub use i64_as_bson_datetime::{
deserialize as deserialize_i64_from_bson_datetime,
serialize as serialize_i64_as_bson_datetime,
};
#[doc(inline)]
pub use rfc3339_string_as_bson_datetime::{
Expand Down Expand Up @@ -424,14 +424,14 @@ pub mod hex_string_as_object_id {
///
/// ```rust
/// # use serde::{Serialize, Deserialize};
/// # use bson::serde_helpers::i64_as_datetime;
/// # use bson::serde_helpers::i64_as_bson_datetime;
/// #[derive(Serialize, Deserialize)]
/// struct Item {
/// #[serde(with = "i64_as_datetime")]
/// #[serde(with = "i64_as_bson_datetime")]
/// pub now: i64,
/// }
/// ```
pub mod i64_as_datetime {
pub mod i64_as_bson_datetime {
use crate::DateTime;
use serde::{Deserialize, Deserializer, Serialize, Serializer};

Expand Down
6 changes: 3 additions & 3 deletions src/tests/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{
serde_helpers::{
bson_datetime_as_rfc3339_string,
hex_string_as_object_id,
i64_as_datetime,
i64_as_bson_datetime,
rfc3339_string_as_bson_datetime,
serialize_object_id_as_hex_string,
timestamp_as_u32,
Expand Down Expand Up @@ -888,12 +888,12 @@ fn test_oid_helpers() {
}

#[test]
fn test_i64_as_datetime() {
fn test_i64_as_bson_datetime() {
let _guard = LOCK.run_concurrently();

#[derive(Serialize, Deserialize)]
struct A {
#[serde(with = "i64_as_datetime")]
#[serde(with = "i64_as_bson_datetime")]
now: i64,
}

Expand Down