mirror of
https://github.com/logos-messaging/logos-messaging-rust-bindings.git
synced 2026-01-04 23:13:07 +00:00
Use LocalResult for Chat2Message.timestamp
This commit is contained in:
parent
f14a05644a
commit
cc2268fc4a
@ -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> {
|
||||
Utc.timestamp_opt(self.timestamp as i64, 0).expect("Timestamps should not come out of bounds")
|
||||
pub fn timestamp(&self) -> LocalResult<DateTime<Utc>> {
|
||||
Utc.timestamp_opt(self.timestamp as i64, 0)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user