1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

Merge pull request #6149 from mvo5/fix-deprecated-timestamp_subsec_nanos

tests: fix deprecation warning `timestamp_subsec_nanos()`
This commit is contained in:
Daniel Hofstetter 2024-03-30 13:24:23 +01:00 committed by GitHub
commit 4a64337f52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -34,7 +34,10 @@ fn set_file_times(at: &AtPath, path: &str, atime: FileTime, mtime: FileTime) {
fn str_to_filetime(format: &str, s: &str) -> FileTime { fn str_to_filetime(format: &str, s: &str) -> FileTime {
let tm = chrono::NaiveDateTime::parse_from_str(s, format).unwrap(); let tm = chrono::NaiveDateTime::parse_from_str(s, format).unwrap();
FileTime::from_unix_time(tm.and_utc().timestamp(), tm.timestamp_subsec_nanos()) FileTime::from_unix_time(
tm.and_utc().timestamp(),
tm.and_utc().timestamp_subsec_nanos(),
)
} }
#[test] #[test]