From 916e98a2e6cfda593b23bc4e76b137cb92660463 Mon Sep 17 00:00:00 2001 From: OMGeeky Date: Sat, 20 Apr 2024 11:55:16 +0200 Subject: [PATCH] replace deprecated method --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 4718f12..72df020 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,6 @@ use std::ops::Deref; -use chrono::{DateTime, NaiveDateTime, Utc}; +use chrono::{DateTime, Utc}; use reqwest::{Error, Request, Response}; use url::Host; @@ -201,8 +201,8 @@ fn get_twitch_rate_limit_value(response: &Response) -> Result> { .to_string() .parse::() .map_err(|e| ReqwestBackoffError::Other(e.into()))?; - let timestamp = NaiveDateTime::from_timestamp_opt(timestamp, 0).ok_or( + let timestamp: DateTime = DateTime::from_timestamp(timestamp, 0).ok_or( ReqwestBackoffError::Other("Could not convert the provided timestamp".into()), )?; - Ok(timestamp.and_utc()) + Ok(timestamp) }