From 59ab9df6ba60bc61a14add8825bd250c8488dc1c Mon Sep 17 00:00:00 2001 From: BlackSoulHub Date: Wed, 10 Apr 2024 07:27:37 +0000 Subject: [PATCH 1/3] update time to 0.3.35 --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- sqlx-sqlite/src/types/time.rs | 35 ++++++++++++++++++----------------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 75dbfb27cc..b470acf8ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3740,9 +3740,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "ef89ece63debf11bc32d1ed8d078ac870cbeb44da02afb02a9ff135ae7ca0582" dependencies = [ "deranged", "itoa", @@ -3761,9 +3761,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", diff --git a/Cargo.toml b/Cargo.toml index 018d8a2a92..f1232ca834 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -136,7 +136,7 @@ chrono = { version = "0.4.22", default-features = false } ipnetwork = "0.20.0" mac_address = "1.1.5" rust_decimal = "1.26.1" -time = { version = "0.3.14", features = ["formatting", "parsing", "macros"] } +time = { version = "0.3.35", features = ["formatting", "parsing", "macros"] } uuid = "1.1.2" # Common utility crates diff --git a/sqlx-sqlite/src/types/time.rs b/sqlx-sqlite/src/types/time.rs index efd546213f..03e6aad22b 100644 --- a/sqlx-sqlite/src/types/time.rs +++ b/sqlx-sqlite/src/types/time.rs @@ -7,7 +7,7 @@ use crate::{ types::Type, Sqlite, SqliteArgumentValue, SqliteTypeInfo, SqliteValueRef, }; -use time::format_description::{well_known::Rfc3339, FormatItem}; +use time::format_description::{BorrowedFormatItem, well_known::Rfc3339}; use time::macros::format_description as fd; use time::{Date, OffsetDateTime, PrimitiveDateTime, Time}; @@ -177,11 +177,11 @@ fn decode_datetime_from_text(value: &str) -> Option { } let formats = [ - FormatItem::Compound(formats::PRIMITIVE_DATE_TIME_SPACE_SEPARATED), - FormatItem::Compound(formats::PRIMITIVE_DATE_TIME_T_SEPARATED), + BorrowedFormatItem::Compound(formats::PRIMITIVE_DATE_TIME_SPACE_SEPARATED), + BorrowedFormatItem::Compound(formats::PRIMITIVE_DATE_TIME_T_SEPARATED), ]; - if let Ok(dt) = PrimitiveDateTime::parse(value, &FormatItem::First(&formats)) { + if let Ok(dt) = PrimitiveDateTime::parse(value, &BorrowedFormatItem::First(&formats)) { return Some(dt); } @@ -189,9 +189,10 @@ fn decode_datetime_from_text(value: &str) -> Option { } mod formats { - use time::format_description::{modifier, Component::*, FormatItem, FormatItem::*}; + use time::format_description::{modifier, Component::*, BorrowedFormatItem}; + use time::format_description::BorrowedFormatItem::{Component, Literal, Optional}; - const YEAR: FormatItem<'_> = Component(Year({ + const YEAR: BorrowedFormatItem<'_> = Component(Year({ let mut value = modifier::Year::default(); value.padding = modifier::Padding::Zero; value.repr = modifier::YearRepr::Full; @@ -200,7 +201,7 @@ mod formats { value })); - const MONTH: FormatItem<'_> = Component(Month({ + const MONTH: BorrowedFormatItem<'_> = Component(Month({ let mut value = modifier::Month::default(); value.padding = modifier::Padding::Zero; value.repr = modifier::MonthRepr::Numerical; @@ -208,51 +209,51 @@ mod formats { value })); - const DAY: FormatItem<'_> = Component(Day({ + const DAY: BorrowedFormatItem<'_> = Component(Day({ let mut value = modifier::Day::default(); value.padding = modifier::Padding::Zero; value })); - const HOUR: FormatItem<'_> = Component(Hour({ + const HOUR: BorrowedFormatItem<'_> = Component(Hour({ let mut value = modifier::Hour::default(); value.padding = modifier::Padding::Zero; value.is_12_hour_clock = false; value })); - const MINUTE: FormatItem<'_> = Component(Minute({ + const MINUTE: BorrowedFormatItem<'_> = Component(Minute({ let mut value = modifier::Minute::default(); value.padding = modifier::Padding::Zero; value })); - const SECOND: FormatItem<'_> = Component(Second({ + const SECOND: BorrowedFormatItem<'_> = Component(Second({ let mut value = modifier::Second::default(); value.padding = modifier::Padding::Zero; value })); - const SUBSECOND: FormatItem<'_> = Component(Subsecond({ + const SUBSECOND: BorrowedFormatItem<'_> = Component(Subsecond({ let mut value = modifier::Subsecond::default(); value.digits = modifier::SubsecondDigits::OneOrMore; value })); - const OFFSET_HOUR: FormatItem<'_> = Component(OffsetHour({ + const OFFSET_HOUR: BorrowedFormatItem<'_> = Component(OffsetHour({ let mut value = modifier::OffsetHour::default(); value.sign_is_mandatory = true; value.padding = modifier::Padding::Zero; value })); - const OFFSET_MINUTE: FormatItem<'_> = Component(OffsetMinute({ + const OFFSET_MINUTE: BorrowedFormatItem<'_> = Component(OffsetMinute({ let mut value = modifier::OffsetMinute::default(); value.padding = modifier::Padding::Zero; value })); - pub(super) const OFFSET_DATE_TIME: &[FormatItem<'_>] = { + pub(super) const OFFSET_DATE_TIME: &[BorrowedFormatItem<'_>] = { &[ YEAR, Literal(b"-"), @@ -274,7 +275,7 @@ mod formats { ] }; - pub(super) const PRIMITIVE_DATE_TIME_SPACE_SEPARATED: &[FormatItem<'_>] = { + pub(super) const PRIMITIVE_DATE_TIME_SPACE_SEPARATED: &[BorrowedFormatItem<'_>] = { &[ YEAR, Literal(b"-"), @@ -293,7 +294,7 @@ mod formats { ] }; - pub(super) const PRIMITIVE_DATE_TIME_T_SEPARATED: &[FormatItem<'_>] = { + pub(super) const PRIMITIVE_DATE_TIME_T_SEPARATED: &[BorrowedFormatItem<'_>] = { &[ YEAR, Literal(b"-"), From a4c74f9a88d7f8dcb4701b82c932620e681f66a0 Mon Sep 17 00:00:00 2001 From: BlackSoulHub Date: Wed, 10 Apr 2024 07:31:12 +0000 Subject: [PATCH 2/3] fmt fix --- sqlx-sqlite/src/types/time.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sqlx-sqlite/src/types/time.rs b/sqlx-sqlite/src/types/time.rs index 03e6aad22b..fa4e947f78 100644 --- a/sqlx-sqlite/src/types/time.rs +++ b/sqlx-sqlite/src/types/time.rs @@ -7,7 +7,7 @@ use crate::{ types::Type, Sqlite, SqliteArgumentValue, SqliteTypeInfo, SqliteValueRef, }; -use time::format_description::{BorrowedFormatItem, well_known::Rfc3339}; +use time::format_description::{well_known::Rfc3339, BorrowedFormatItem}; use time::macros::format_description as fd; use time::{Date, OffsetDateTime, PrimitiveDateTime, Time}; @@ -189,8 +189,8 @@ fn decode_datetime_from_text(value: &str) -> Option { } mod formats { - use time::format_description::{modifier, Component::*, BorrowedFormatItem}; use time::format_description::BorrowedFormatItem::{Component, Literal, Optional}; + use time::format_description::{modifier, BorrowedFormatItem, Component::*}; const YEAR: BorrowedFormatItem<'_> = Component(Year({ let mut value = modifier::Year::default(); From 693de91e8f343bf4a019e4925febb75106ae0426 Mon Sep 17 00:00:00 2001 From: BlackSoulHub Date: Thu, 11 Apr 2024 02:54:52 +0000 Subject: [PATCH 3/3] update version to 0.3.36 --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b470acf8ee..3eebf97ee6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3740,9 +3740,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.35" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef89ece63debf11bc32d1ed8d078ac870cbeb44da02afb02a9ff135ae7ca0582" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", diff --git a/Cargo.toml b/Cargo.toml index f1232ca834..e25ac18b09 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -136,7 +136,7 @@ chrono = { version = "0.4.22", default-features = false } ipnetwork = "0.20.0" mac_address = "1.1.5" rust_decimal = "1.26.1" -time = { version = "0.3.35", features = ["formatting", "parsing", "macros"] } +time = { version = "0.3.36", features = ["formatting", "parsing", "macros"] } uuid = "1.1.2" # Common utility crates