From cc2268fc4a6efce353d8b8377909a0d00c20aa75 Mon Sep 17 00:00:00 2001 From: Felicio Mununga Date: Thu, 1 Dec 2022 16:05:15 +0100 Subject: [PATCH] Use `LocalResult` for `Chat2Message.timestamp` --- examples/toy-chat/src/protocol.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/toy-chat/src/protocol.rs b/examples/toy-chat/src/protocol.rs index f09e82d..673132f 100644 --- a/examples/toy-chat/src/protocol.rs +++ b/examples/toy-chat/src/protocol.rs @@ -1,4 +1,4 @@ -use chrono::{DateTime, TimeZone, Utc}; +use chrono::{DateTime, LocalResult, TimeZone, Utc}; use once_cell::sync::Lazy; use prost::Message; use waku_bindings::{Encoding, WakuContentTopic}; @@ -36,7 +36,7 @@ impl Chat2Message { &self.nick } - pub fn timestamp(&self) -> DateTime { - Utc.timestamp_opt(self.timestamp as i64, 0).expect("Timestamps should not come out of bounds") + pub fn timestamp(&self) -> LocalResult> { + Utc.timestamp_opt(self.timestamp as i64, 0) } }