Skip to content

Commit 71bd61d

Browse files
committed
fix(sqlite): silence time 0.3.48 modifier deprecations under -D warnings
time 0.3.48 deprecated the field-based `modifier::{Year, Month, Hour}` format components and raw-byte `Literal`, which broke `clippy -D warnings` in CI (no Cargo.lock, so the latest `time` is resolved). The new `#[non_exhaustive]` replacements aren't const-constructible the way these `const` format items need, and the deprecated API still works, so scope an `#![allow(deprecated)]` to `mod formats` as a stopgap. Tracking for migration: #4310 Signed-off-by: Bailey Hayes <bailey@cosmonic.com>
1 parent 3da582a commit 71bd61d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

sqlx-sqlite/src/types/time.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,15 @@ fn decode_datetime_from_text(value: &str) -> Option<PrimitiveDateTime> {
193193
}
194194

195195
mod formats {
196+
// `time` 0.3.48 deprecated the field-based `modifier::{Year, Month, Hour}`
197+
// components and the raw-byte `BorrowedFormatItem::Literal` in favor of new
198+
// `#[non_exhaustive]` components (`Year*`, `Month*`, `Hour24`, `StringLiteral`).
199+
// Those replacements aren't `const`-constructible the way the format items
200+
// below require, and the deprecated API still works, so suppress the lint
201+
// here until the format builders are migrated.
202+
// Tracking: https://github.com/transact-rs/sqlx/issues/4310
203+
#![allow(deprecated)]
204+
196205
use time::format_description::BorrowedFormatItem::{Component, Literal, Optional};
197206
use time::format_description::{modifier, BorrowedFormatItem, Component::*};
198207

0 commit comments

Comments
 (0)