From f90c01f702f6a98b041f766b6a1d857bc1b9afef Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Mon, 11 Sep 2023 09:26:05 +0100 Subject: replace chrono with time (#806) * replace chrono with time * Fix test chrono usage --------- Co-authored-by: Ellie Huxtable --- atuin-common/src/api.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'atuin-common/src/api.rs') 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, + #[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, - pub history_ts: chrono::DateTime, + #[serde(with = "time::serde::rfc3339")] + pub sync_ts: OffsetDateTime, + #[serde(with = "time::serde::rfc3339")] + pub history_ts: OffsetDateTime, pub host: String, } -- cgit v1.3.1