mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-27 11:08:05 +00:00
Update time to 0.3.36 (#3190)
* update time to 0.3.35 * fmt fix * update version to 0.3.36
This commit is contained in:
parent
03926dec15
commit
6a4f61e3b3
8
Cargo.lock
generated
8
Cargo.lock
generated
@ -3740,9 +3740,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "time"
|
||||
version = "0.3.34"
|
||||
version = "0.3.36"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749"
|
||||
checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
|
||||
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",
|
||||
|
||||
@ -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.36", features = ["formatting", "parsing", "macros"] }
|
||||
uuid = "1.1.2"
|
||||
|
||||
# Common utility crates
|
||||
|
||||
@ -7,7 +7,7 @@ use crate::{
|
||||
types::Type,
|
||||
Sqlite, SqliteArgumentValue, SqliteTypeInfo, SqliteValueRef,
|
||||
};
|
||||
use time::format_description::{well_known::Rfc3339, FormatItem};
|
||||
use time::format_description::{well_known::Rfc3339, BorrowedFormatItem};
|
||||
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<PrimitiveDateTime> {
|
||||
}
|
||||
|
||||
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<PrimitiveDateTime> {
|
||||
}
|
||||
|
||||
mod formats {
|
||||
use time::format_description::{modifier, Component::*, FormatItem, FormatItem::*};
|
||||
use time::format_description::BorrowedFormatItem::{Component, Literal, Optional};
|
||||
use time::format_description::{modifier, BorrowedFormatItem, Component::*};
|
||||
|
||||
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"-"),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user