Fix (Naive)DateTime warning on UTC conversion
Some checks failed
ci/woodpecker/push/debug Pipeline failed
ci/woodpecker/pr/debug Pipeline failed

This commit is contained in:
Maximilien R. 2024-08-06 23:40:55 +02:00
parent 514c093501
commit 88f91210cf

View file

@ -388,15 +388,12 @@ fn check_size_filter(version_data: &ObjectVersionData, filter: &LifecycleFilter)
fn midnight_ts(date: NaiveDate) -> u64 {
date.and_hms_opt(0, 0, 0)
.expect("midnight does not exist")
.timestamp_millis() as u64
.and_utc().timestamp_millis() as u64
}
fn next_date(ts: u64) -> NaiveDate {
NaiveDateTime::from_timestamp_millis(ts as i64)
.expect("bad timestamp")
.date()
.succ_opt()
.expect("no next day")
DateTime::from_timestamp_millis(ts as i64)
.expect("bad timestamp").date_naive()
}
fn today() -> NaiveDate {