Skip to content

Commit

Permalink
Update deprecated TimeZone::datetime_from
Browse files Browse the repository at this point in the history
This was a transition to appropriate use of
NaiveDateTime::parse_from_str(/**/).and_utc() as discussed in
chronotope/chrono#1251.

Signed-off-by: Jason Heath <jason.heath@progress.com>
  • Loading branch information
Jason Heath committed Sep 6, 2023
1 parent 8529cf0 commit 9501285
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/builder-api-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ pub struct PendingOriginInvitationsResponse {
// `DateTime<Utc>`-typed struct fields.
mod json_date_format {
use chrono::{DateTime,
TimeZone,
NaiveDateTime,
Utc};
use serde::{self,
Deserialize,
Expand All @@ -218,8 +218,8 @@ mod json_date_format {
where D: Deserializer<'de>
{
let s = String::deserialize(deserializer)?;
Utc.datetime_from_str(&s, DATE_FORMAT)
.map_err(serde::de::Error::custom)
NaiveDateTime::parse_from_str(&s, DATE_FORMAT).map(|v| v.and_utc())
.map_err(serde::de::Error::custom)
}
}

Expand Down

0 comments on commit 9501285

Please sign in to comment.