1
0
mirror of https://github.com/scsibug/nostr-rs-relay.git synced 2025-04-20 03:49:56 -04:00

refactor: clippy suggestions

This commit is contained in:
Greg Heartsfield 2021-12-29 22:49:46 -06:00
parent f415295184
commit 3302fb2e81

@ -78,8 +78,7 @@ impl Event {
// don't bother to validate an event with a timestamp in the distant future. // don't bother to validate an event with a timestamp in the distant future.
let config = config::SETTINGS.read().unwrap(); let config = config::SETTINGS.read().unwrap();
let max_future_sec = config.options.reject_future_seconds; let max_future_sec = config.options.reject_future_seconds;
if max_future_sec.is_some() { if let Some(allowable_future) = max_future_sec {
let allowable_future = max_future_sec.unwrap();
let curr_time = unix_time(); let curr_time = unix_time();
// calculate difference, plus how far future we allow // calculate difference, plus how far future we allow
if curr_time + (allowable_future as u64) < self.created_at { if curr_time + (allowable_future as u64) < self.created_at {