1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-20 12:02:22 +03:00

Apply cargo fmt following changes in nightly rustfmt

rustfmt now formats `let … else { … }` expressions
This commit is contained in:
Quentin Gliech
2023-07-03 14:50:59 +02:00
parent 991e18d426
commit 4f8b87fbfe
10 changed files with 47 additions and 16 deletions

View File

@@ -41,8 +41,12 @@ pub struct Payload {
impl Payload {
fn expired(&self, now: DateTime<Utc>) -> bool {
let Ok(ts) = self.session.timestamp_ms().try_into() else { return true };
let Some(when) = NaiveDateTime::from_timestamp_millis(ts) else { return true };
let Ok(ts) = self.session.timestamp_ms().try_into() else {
return true;
};
let Some(when) = NaiveDateTime::from_timestamp_millis(ts) else {
return true;
};
let when = DateTime::from_utc(when, Utc);
let max_age = Duration::seconds(SESSION_MAX_TIME_SECS);
now - when > max_age