diff options
| author | Conrad Ludgate <conradludgate@gmail.com> | 2023-09-11 09:26:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-11 09:26:05 +0100 |
| commit | f90c01f702f6a98b041f766b6a1d857bc1b9afef (patch) | |
| tree | 04a4755bd632abdcf398d0ce903163ed60a5a212 /atuin-common/src/api.rs | |
| parent | Use `case` for Linux distro choice in `install.sh` (#1200) (diff) | |
| download | atuin-f90c01f702f6a98b041f766b6a1d857bc1b9afef.zip | |
replace chrono with time (#806)
* replace chrono with time
* Fix test chrono usage
---------
Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
Diffstat (limited to 'atuin-common/src/api.rs')
| -rw-r--r-- | atuin-common/src/api.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/atuin-common/src/api.rs b/atuin-common/src/api.rs index 5622bd82..ddcc0b09 100644 --- a/atuin-common/src/api.rs +++ b/atuin-common/src/api.rs @@ -1,6 +1,6 @@ -use chrono::Utc; use serde::{Deserialize, Serialize}; use std::borrow::Cow; +use time::OffsetDateTime; #[derive(Debug, Serialize, Deserialize)] pub struct UserResponse { @@ -36,7 +36,8 @@ pub struct LoginResponse { #[derive(Debug, Serialize, Deserialize)] pub struct AddHistoryRequest { pub id: String, - pub timestamp: chrono::DateTime<Utc>, + #[serde(with = "time::serde::rfc3339")] + pub timestamp: OffsetDateTime, pub data: String, pub hostname: String, } @@ -48,8 +49,10 @@ pub struct CountResponse { #[derive(Debug, Serialize, Deserialize)] pub struct SyncHistoryRequest { - pub sync_ts: chrono::DateTime<chrono::FixedOffset>, - pub history_ts: chrono::DateTime<chrono::FixedOffset>, + #[serde(with = "time::serde::rfc3339")] + pub sync_ts: OffsetDateTime, + #[serde(with = "time::serde::rfc3339")] + pub history_ts: OffsetDateTime, pub host: String, } |
