From dd6fe5e7c017ac0e23e9be25bfdc5703c3c2eb3a Mon Sep 17 00:00:00 2001 From: baoyachi Date: Mon, 18 Jul 2022 19:06:02 +0800 Subject: [PATCH] fix clippy warning --- src/data_time.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/data_time.rs b/src/data_time.rs index da05c78..4c33252 100644 --- a/src/data_time.rs +++ b/src/data_time.rs @@ -31,6 +31,12 @@ pub fn now_data_time() -> DateTime { } } +impl Default for DateTime { + fn default() -> Self { + Self::new() + } +} + impl DateTime { pub fn new() -> Self { Self::local_now().unwrap_or_else(|_| DateTime::Utc(OffsetDateTime::now_utc()))