Skip to content

Commit

Permalink
fix: replace deprecated fn call in example rocket/jwt-authentication (
Browse files Browse the repository at this point in the history
#152)

`chrono::TimeDelta::minutes` to `chrono::TimeDelta::try_minutes`, with `.expect`
  • Loading branch information
supleed2 authored Mar 7, 2024
1 parent c92718e commit 4a05ef9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rocket/jwt-authentication/src/claims.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const SECRET: &str = "secret";

lazy_static! {
/// Time before token expires (aka exp claim)
static ref TOKEN_EXPIRATION: Duration = Duration::minutes(5);
static ref TOKEN_EXPIRATION: Duration = Duration::try_minutes(5)
.expect("failed to create an expiration duration");
}

// Used when decoding a token to `Claims`
Expand Down

0 comments on commit 4a05ef9

Please sign in to comment.