Skip to content

Commit 0de5e53

Browse files
ds-cboconradludgate
authored andcommitted
replace deprecated chrono::DateTime::from_utc
1 parent faa52b2 commit 0de5e53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

postgres-types/src/chrono_04.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl ToSql for NaiveDateTime {
4040
impl<'a> FromSql<'a> for DateTime<Utc> {
4141
fn from_sql(type_: &Type, raw: &[u8]) -> Result<DateTime<Utc>, Box<dyn Error + Sync + Send>> {
4242
let naive = NaiveDateTime::from_sql(type_, raw)?;
43-
Ok(DateTime::from_utc(naive, Utc))
43+
Ok(Utc::from_utc_datetime(naive))
4444
}
4545

4646
accepts!(TIMESTAMPTZ);

0 commit comments

Comments
 (0)