From da4009b0b73b9cdf9972b6d3ae36ea50083df192 Mon Sep 17 00:00:00 2001 From: Valentin Tolmer Date: Fri, 14 May 2021 10:22:50 +0200 Subject: [PATCH] Implement Default for User --- model/src/lib.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/model/src/lib.rs b/model/src/lib.rs index 408b198..bc45991 100644 --- a/model/src/lib.rs +++ b/model/src/lib.rs @@ -33,6 +33,19 @@ pub struct User { pub creation_date: chrono::NaiveDateTime, } +impl Default for User { + fn default() -> Self { + User { + user_id: String::new(), + email: String::new(), + display_name: String::new(), + first_name: String::new(), + last_name: String::new(), + creation_date: chrono::NaiveDateTime::from_timestamp(0, 0), + } + } +} + #[derive(PartialEq, Eq, Debug, Serialize, Deserialize)] pub struct Group { pub display_name: String,