Switch to Duration::from_secs, because we don't need nanos.

This commit is contained in:
projectmoon 2021-02-10 20:30:17 +00:00
parent 7e23f80e42
commit 67291e6deb
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ fn check_message_age(
oldest_message_age: u64, oldest_message_age: u64,
) -> bool { ) -> bool {
let sending_time = event.origin_server_ts; 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 { if sending_time > oldest_timestamp {
true true