Skip to content

Commit

Permalink
chore: Migrate away from deprecated constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
hrkfdn committed Mar 9, 2024
1 parent 523d33e commit ed3ff21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/spotify_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ impl WebApi {
if let Ok(Some(token)) = token_rx.recv() {
*api_token.lock().unwrap() = Some(Token {
access_token: token.access_token,
expires_in: chrono::Duration::seconds(token.expires_in.into()),
expires_in: chrono::Duration::try_seconds(token.expires_in.into()).unwrap(),
scopes: HashSet::from_iter(token.scope),
expires_at: None,
refresh_token: None,
});
*api_token_expiration.write().unwrap() =
Utc::now() + ChronoDuration::seconds(token.expires_in.into());
Utc::now() + ChronoDuration::try_seconds(token.expires_in.into()).unwrap();
} else {
error!("Failed to update token");
}
Expand Down

0 comments on commit ed3ff21

Please sign in to comment.