Skip to content

Commit 0bddfe6

Browse files
committed
Place chrono-dependent code behind feature flag
1 parent 334b16e commit 0bddfe6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

influxdb/src/query/write_query.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use crate::query::line_proto_term::LineProtoTerm;
66
use crate::query::{QueryType, ValidQuery};
77
use crate::{Error, Query, Timestamp};
8-
use chrono::{DateTime, TimeZone};
98
use std::fmt::{Display, Formatter};
109

1110
pub trait WriteType {
@@ -154,8 +153,9 @@ impl From<&str> for Type {
154153
}
155154
}
156155

157-
impl<Tz: TimeZone> From<DateTime<Tz>> for Type {
158-
fn from(dt: DateTime<Tz>) -> Self {
156+
#[cfg(feature = "chrono")]
157+
impl<Tz: chrono::TimeZone> From<chrono::DateTime<Tz>> for Type {
158+
fn from(dt: chrono::DateTime<Tz>) -> Self {
159159
match dt.timestamp_nanos_opt() {
160160
Some(nanos) => Type::SignedInteger(nanos),
161161
None => {

0 commit comments

Comments
 (0)