Skip to content

Commit 13968a1

Browse files
committed
simplify chrono "imports"
1 parent abfd0bb commit 13968a1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

influxdb/src/query/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,19 @@ impl fmt::Display for Timestamp {
7070
}
7171

7272
#[cfg(feature = "chrono")]
73-
impl From<Timestamp> for chrono::prelude::DateTime<chrono::prelude::Utc> {
74-
fn from(ts: Timestamp) -> chrono::prelude::DateTime<chrono::prelude::Utc> {
75-
use chrono::prelude::TimeZone;
76-
chrono::prelude::Utc.timestamp_nanos(ts.nanos() as i64)
73+
impl From<Timestamp> for chrono::DateTime<chrono::Utc> {
74+
fn from(ts: Timestamp) -> chrono::DateTime<chrono::Utc> {
75+
use chrono::TimeZone as _;
76+
chrono::Utc.timestamp_nanos(ts.nanos() as i64)
7777
}
7878
}
7979

8080
#[cfg(feature = "chrono")]
81-
impl<T> From<chrono::prelude::DateTime<T>> for Timestamp
81+
impl<T> From<chrono::DateTime<T>> for Timestamp
8282
where
83-
T: chrono::prelude::TimeZone,
83+
T: chrono::TimeZone,
8484
{
85-
fn from(date_time: chrono::prelude::DateTime<T>) -> Self {
85+
fn from(date_time: chrono::DateTime<T>) -> Self {
8686
Timestamp::Nanoseconds(date_time.timestamp_nanos_opt().unwrap() as u128)
8787
}
8888
}

0 commit comments

Comments
 (0)