place chrono dep behind feature
This commit is contained in:
parent
9c2943f56c
commit
c8337c182a
2 changed files with 11 additions and 1 deletions
|
@ -4,7 +4,6 @@ version = "0.1.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
chrono = { version = "0.4.42", features = ["serde"] }
|
|
||||||
derive_builder = { version = "0.20.2", features = ["clippy"] }
|
derive_builder = { version = "0.20.2", features = ["clippy"] }
|
||||||
futures = "0.3.31"
|
futures = "0.3.31"
|
||||||
percent-encoding = "2.3.2"
|
percent-encoding = "2.3.2"
|
||||||
|
@ -12,3 +11,7 @@ reqwest = { version = "0.12.23", features = ["json"] }
|
||||||
serde = { version = "1.0.219", features = ["derive"] }
|
serde = { version = "1.0.219", features = ["derive"] }
|
||||||
serde_json = "1.0.143"
|
serde_json = "1.0.143"
|
||||||
thiserror = "2.0.16"
|
thiserror = "2.0.16"
|
||||||
|
chrono = { version = "0.4.42", features = ["serde"], optional = true }
|
||||||
|
|
||||||
|
[features]
|
||||||
|
chrono = ["dep:chrono"]
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#[cfg(feature = "chrono")]
|
||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, Utc};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
|
||||||
|
@ -10,9 +11,15 @@ where
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
||||||
/// Timestamp of record creation.
|
/// Timestamp of record creation.
|
||||||
|
#[cfg(feature = "chrono")]
|
||||||
#[serde(rename = "createdTime")]
|
#[serde(rename = "createdTime")]
|
||||||
pub created_time: DateTime<Utc>,
|
pub created_time: DateTime<Utc>,
|
||||||
|
|
||||||
|
/// Timestamp of record creation.
|
||||||
|
#[cfg(not(feature = "chrono"))]
|
||||||
|
#[serde(rename = "createdTime")]
|
||||||
|
pub created_time: String,
|
||||||
|
|
||||||
/// Contents of record data.
|
/// Contents of record data.
|
||||||
pub fields: T,
|
pub fields: T,
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue