Skip to content

Commit 6051780

Browse files
committed
fix chrono deprecations
https://github.com/chronotope/chrono/releases/tag/v0.4.27: warning: use of deprecated associated function `chrono::DateTime::<Tz>::from_utc`: Use TimeZone::from_utc_datetime() or DateTime::from_naive_utc_and_offset instead --> database\src\pool\sqlite.rs:955:103 | 955 | ... commit_date: row.get::<_, Option<i64>>(6).unwrap().map(|timestamp| Date(DateTime::from_utc(NaiveDateTime::from_timestamp_opt(timest... | ^^^^^^^^ | = note: `#[warn(deprecated)]` on by default warning: use of deprecated associated function `chrono::DateTime::<Tz>::from_utc`: Use TimeZone::from_utc_datetime() or DateTime::from_naive_utc_and_offset instead --> database\src\pool\sqlite.rs:986:107 | 986 | ... commit_date: row.get::<_, Option<i64>>(6).unwrap().map(|timestamp| Date(DateTime::from_utc(NaiveDateTime::from_timestamp_opt(timest... |
1 parent e3b3b8f commit 6051780

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

database/src/pool/sqlite.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ impl Connection for SqliteConnection {
952952
include: row.get(3).unwrap(),
953953
exclude: row.get(4).unwrap(),
954954
runs: row.get(5).unwrap(),
955-
commit_date: row.get::<_, Option<i64>>(6).unwrap().map(|timestamp| Date(DateTime::from_utc(NaiveDateTime::from_timestamp_opt(timestamp, 0).unwrap(), Utc)))
955+
commit_date: row.get::<_, Option<i64>>(6).unwrap().map(|timestamp| Date(NaiveDateTime::from_timestamp_opt(timestamp, 0).unwrap().and_utc()))
956956
})
957957
})
958958
.collect::<Result<Vec<_>, _>>()
@@ -983,7 +983,7 @@ impl Connection for SqliteConnection {
983983
include: row.get(3).unwrap(),
984984
exclude: row.get(4).unwrap(),
985985
runs: row.get(5).unwrap(),
986-
commit_date: row.get::<_, Option<i64>>(6).unwrap().map(|timestamp| Date(DateTime::from_utc(NaiveDateTime::from_timestamp_opt(timestamp, 0).unwrap(), Utc)))
986+
commit_date: row.get::<_, Option<i64>>(6).unwrap().map(|timestamp| Date(NaiveDateTime::from_timestamp_opt(timestamp, 0).unwrap().and_utc()))
987987
})
988988
},
989989
)

0 commit comments

Comments
 (0)