Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam-Gleave committed Jan 27, 2022
1 parent bd59cf0 commit 13c9475
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions auth-helper/src/jwt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,12 @@ impl ClaimsBuilder {
let mut claims = Claims::new(self.iss, self.sub, self.aud, now);

if let Some(exp) = self.exp {
claims.exp = now
.checked_add(exp)
.ok_or_else(|| Error::InvalidExpiry {
issued_at: now,
expiry: exp,
})
.map(|exp| Some(exp))?;
let expiry = now.checked_add(exp).ok_or(Error::InvalidExpiry {
issued_at: now,
expiry: exp,
})?;

claims.exp = Some(expiry);
}

Ok(claims)
Expand Down

0 comments on commit 13c9475

Please sign in to comment.