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