File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -755,11 +755,11 @@ impl<'dir> File<'dir> {
755
755
fn systemtime_to_naivedatetime ( st : SystemTime ) -> Option < NaiveDateTime > {
756
756
let duration = st. duration_since ( SystemTime :: UNIX_EPOCH ) . ok ( ) ?;
757
757
758
- // FIXME: NaiveDateTime::from_timestamp_opt is deprecated since chrono 0.4.35
759
- NaiveDateTime :: from_timestamp_opt (
758
+ DateTime :: from_timestamp (
760
759
duration. as_secs ( ) . try_into ( ) . ok ( ) ?,
761
760
( duration. as_nanos ( ) % 1_000_000_000 ) . try_into ( ) . ok ( ) ?,
762
761
)
762
+ . map ( |dt| dt. naive_local ( ) )
763
763
}
764
764
765
765
/// This file’s last modified timestamp, if available on this platform.
@@ -786,10 +786,11 @@ impl<'dir> File<'dir> {
786
786
} ;
787
787
}
788
788
let md = self . metadata ( ) ;
789
- NaiveDateTime :: from_timestamp_opt (
789
+ DateTime :: from_timestamp (
790
790
md. map_or ( 0 , MetadataExt :: ctime) ,
791
791
md. map_or ( 0 , |md| md. ctime_nsec ( ) as u32 ) ,
792
792
)
793
+ . map ( |dt| dt. naive_local ( ) )
793
794
}
794
795
795
796
#[ cfg( windows) ]
You can’t perform that action at this time.
0 commit comments