From 90ca6bd6260028f382f101c5c0d59d330d9b4324 Mon Sep 17 00:00:00 2001 From: dracarys18 Date: Fri, 19 Apr 2024 18:37:32 +0530 Subject: [PATCH 1/5] fix: change time precision to 6 --- crates/common_utils/src/custom_serde.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/common_utils/src/custom_serde.rs b/crates/common_utils/src/custom_serde.rs index 79e0c5b85e76..c88650b133dc 100644 --- a/crates/common_utils/src/custom_serde.rs +++ b/crates/common_utils/src/custom_serde.rs @@ -19,7 +19,7 @@ pub mod iso8601 { const FORMAT_CONFIG: EncodedConfig = Config::DEFAULT .set_time_precision(TimePrecision::Second { - decimal_digits: NonZeroU8::new(3), + decimal_digits: NonZeroU8::new(6), }) .encode(); From 280852e14f9b640fd7421f2d9c3bee6d39753283 Mon Sep 17 00:00:00 2001 From: dracarys18 Date: Fri, 19 Apr 2024 18:51:53 +0530 Subject: [PATCH 2/5] fix: keep the format config to default --- crates/common_utils/src/custom_serde.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/crates/common_utils/src/custom_serde.rs b/crates/common_utils/src/custom_serde.rs index c88650b133dc..5d87dc118f8e 100644 --- a/crates/common_utils/src/custom_serde.rs +++ b/crates/common_utils/src/custom_serde.rs @@ -5,23 +5,18 @@ /// /// [PrimitiveDateTime]: ::time::PrimitiveDateTime pub mod iso8601 { - use std::num::NonZeroU8; use serde::{ser::Error as _, Deserializer, Serialize, Serializer}; use time::{ format_description::well_known::{ - iso8601::{Config, EncodedConfig, TimePrecision}, + iso8601::{Config, EncodedConfig}, Iso8601, }, serde::iso8601, PrimitiveDateTime, UtcOffset, }; - const FORMAT_CONFIG: EncodedConfig = Config::DEFAULT - .set_time_precision(TimePrecision::Second { - decimal_digits: NonZeroU8::new(6), - }) - .encode(); + const FORMAT_CONFIG: EncodedConfig = Config::DEFAULT.encode(); /// Serialize a [`PrimitiveDateTime`] using the well-known ISO 8601 format. pub fn serialize(date_time: &PrimitiveDateTime, serializer: S) -> Result From dfd6b3079fddd4209b036ffc1412396976df22ec Mon Sep 17 00:00:00 2001 From: dracarys18 Date: Mon, 22 Apr 2024 13:56:54 +0530 Subject: [PATCH 3/5] fix: change time dependency --- crates/common_utils/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/common_utils/Cargo.toml b/crates/common_utils/Cargo.toml index 6f08649fbda5..9725ab255099 100644 --- a/crates/common_utils/Cargo.toml +++ b/crates/common_utils/Cargo.toml @@ -36,7 +36,7 @@ serde_urlencoded = "0.7.1" signal-hook = { version = "0.3.17", optional = true } strum = { version = "0.26.2", features = ["derive"] } thiserror = "1.0.58" -time = { version = "0.3.35", features = ["serde", "serde-well-known", "std"] } +time = { git = "https://github.com/dracarys18/time.git", features = ["serde", "serde-well-known", "std"] } tokio = { version = "1.37.0", features = ["macros", "rt-multi-thread"], optional = true } semver = { version = "1.0.22", features = ["serde"] } uuid = { version = "1.8.0", features = ["v7"] } From c34274126b89d2720de6c0d7757f478b379a021c Mon Sep 17 00:00:00 2001 From: dracarys18 Date: Tue, 23 Apr 2024 15:32:11 +0530 Subject: [PATCH 4/5] fix: dont change to fork --- crates/common_utils/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/common_utils/Cargo.toml b/crates/common_utils/Cargo.toml index 9725ab255099..6f08649fbda5 100644 --- a/crates/common_utils/Cargo.toml +++ b/crates/common_utils/Cargo.toml @@ -36,7 +36,7 @@ serde_urlencoded = "0.7.1" signal-hook = { version = "0.3.17", optional = true } strum = { version = "0.26.2", features = ["derive"] } thiserror = "1.0.58" -time = { git = "https://github.com/dracarys18/time.git", features = ["serde", "serde-well-known", "std"] } +time = { version = "0.3.35", features = ["serde", "serde-well-known", "std"] } tokio = { version = "1.37.0", features = ["macros", "rt-multi-thread"], optional = true } semver = { version = "1.0.22", features = ["serde"] } uuid = { version = "1.8.0", features = ["v7"] } From af71e8101f921a5a810da5c2e905df693a752794 Mon Sep 17 00:00:00 2001 From: dracarys18 Date: Tue, 23 Apr 2024 15:51:09 +0530 Subject: [PATCH 5/5] fix: change precision to 6 --- crates/common_utils/src/custom_serde.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/common_utils/src/custom_serde.rs b/crates/common_utils/src/custom_serde.rs index 5d87dc118f8e..5b859a050022 100644 --- a/crates/common_utils/src/custom_serde.rs +++ b/crates/common_utils/src/custom_serde.rs @@ -9,14 +9,17 @@ pub mod iso8601 { use serde::{ser::Error as _, Deserializer, Serialize, Serializer}; use time::{ format_description::well_known::{ - iso8601::{Config, EncodedConfig}, + iso8601::{Config, EncodedConfig, TimePrecision}, Iso8601, }, serde::iso8601, PrimitiveDateTime, UtcOffset, }; - const FORMAT_CONFIG: EncodedConfig = Config::DEFAULT.encode(); + const FORMAT_CONFIG: EncodedConfig = + Config::DEFAULT.set_time_precision(TimePrecision::Second { + decimal_digits: Some(6), + }); /// Serialize a [`PrimitiveDateTime`] using the well-known ISO 8601 format. pub fn serialize(date_time: &PrimitiveDateTime, serializer: S) -> Result