From 67291e6debab63ec23cab52cb2d595a745b25aa4 Mon Sep 17 00:00:00 2001 From: projectmoon Date: Wed, 10 Feb 2021 20:30:17 +0000 Subject: [PATCH] Switch to Duration::from_secs, because we don't need nanos. --- src/bot/event_handlers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bot/event_handlers.rs b/src/bot/event_handlers.rs index cbc895c..f934afc 100644 --- a/src/bot/event_handlers.rs +++ b/src/bot/event_handlers.rs @@ -27,7 +27,7 @@ fn check_message_age( oldest_message_age: u64, ) -> bool { let sending_time = event.origin_server_ts; - let oldest_timestamp = SystemTime::now().sub(Duration::new(oldest_message_age, 0)); + let oldest_timestamp = SystemTime::now().sub(Duration::from_secs(oldest_message_age)); if sending_time > oldest_timestamp { true