You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-07-31 09:24:31 +03:00
Apply cargo fmt
following changes in nightly rustfmt
rustfmt now formats `let … else { … }` expressions
This commit is contained in:
@ -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
|
||||
|
@ -44,7 +44,9 @@ impl OptionalPostAuthAction {
|
||||
&'a self,
|
||||
repo: &'a mut impl RepositoryAccess,
|
||||
) -> anyhow::Result<Option<PostAuthContext>> {
|
||||
let Some(action) = self.post_auth_action.clone() else { return Ok(None) };
|
||||
let Some(action) = self.post_auth_action.clone() else {
|
||||
return Ok(None);
|
||||
};
|
||||
let ctx = match action {
|
||||
PostAuthAction::ContinueAuthorizationGrant { id } => {
|
||||
let grant = repo
|
||||
|
Reference in New Issue
Block a user