@@ -54,17 +54,21 @@ impl Metadata {
54
54
pub fn modified ( & self ) -> Option < SystemTime > {
55
55
#[ cfg( not( windows) ) ]
56
56
{
57
+ #[ cfg( not( target_os = "aix" ) ) ]
58
+ let seconds = self . 0 . st_mtime ;
59
+ #[ cfg( target_os = "aix" ) ]
60
+ let seconds = self . 0 . st_mtim . tv_sec ;
61
+
62
+ #[ cfg( not( any( target_os = "netbsd" , target_os = "aix" ) ) ) ]
63
+ let nanoseconds = self . 0 . st_mtime_nsec ;
64
+ #[ cfg( target_os = "netbsd" ) ]
65
+ let nanoseconds = self . 0 . st_mtimensec ;
66
+ #[ cfg( target_os = "aix" ) ]
67
+ let nanoseconds = self . 0 . st_mtim . tv_nsec ;
68
+
57
69
Some ( system_time_from_secs_nanos (
58
- #[ cfg( not( target_os = "aix" ) ) ]
59
- self . 0 . st_mtime . try_into ( ) . ok ( ) ?,
60
- #[ cfg( target_os = "aix" ) ]
61
- self . 0 . st_mtim . tv_sec . try_into ( ) . ok ( ) ?,
62
- #[ cfg( not( any( target_os = "netbsd" , target_os = "aix" ) ) ) ]
63
- self . 0 . st_mtime_nsec . try_into ( ) . ok ( ) ?,
64
- #[ cfg( target_os = "netbsd" ) ]
65
- self . 0 . st_mtimensec . try_into ( ) . ok ( ) ?,
66
- #[ cfg( target_os = "aix" ) ]
67
- self . 0 . st_mtim . tv_nsec . try_into ( ) . ok ( ) ?,
70
+ seconds. try_into ( ) . ok ( ) ?,
71
+ nanoseconds. try_into ( ) . ok ( ) ?,
68
72
) )
69
73
}
70
74
#[ cfg( windows) ]
@@ -78,17 +82,21 @@ impl Metadata {
78
82
pub fn created ( & self ) -> Option < SystemTime > {
79
83
#[ cfg( not( windows) ) ]
80
84
{
85
+ #[ cfg( not( target_os = "aix" ) ) ]
86
+ let seconds = self . 0 . st_ctime ;
87
+ #[ cfg( target_os = "aix" ) ]
88
+ let seconds = self . 0 . st_ctim . tv_sec ;
89
+
90
+ #[ cfg( not( any( target_os = "netbsd" , target_os = "aix" ) ) ) ]
91
+ let nanoseconds = self . 0 . st_ctime_nsec ;
92
+ #[ cfg( target_os = "netbsd" ) ]
93
+ let nanoseconds = self . 0 . st_ctimensec ;
94
+ #[ cfg( target_os = "aix" ) ]
95
+ let nanoseconds = self . 0 . st_ctim . tv_nsec ;
96
+
81
97
Some ( system_time_from_secs_nanos (
82
- #[ cfg( not( target_os = "aix" ) ) ]
83
- self . 0 . st_ctime . try_into ( ) . ok ( ) ?,
84
- #[ cfg( target_os = "aix" ) ]
85
- self . 0 . st_ctim . tv_sec . try_into ( ) . ok ( ) ?,
86
- #[ cfg( not( any( target_os = "netbsd" , target_os = "aix" ) ) ) ]
87
- self . 0 . st_ctime_nsec . try_into ( ) . ok ( ) ?,
88
- #[ cfg( target_os = "netbsd" ) ]
89
- self . 0 . st_ctimensec . try_into ( ) . ok ( ) ?,
90
- #[ cfg( target_os = "aix" ) ]
91
- self . 0 . st_ctim . tv_nsec . try_into ( ) . ok ( ) ?,
98
+ seconds. try_into ( ) . ok ( ) ?,
99
+ nanoseconds. try_into ( ) . ok ( ) ?,
92
100
) )
93
101
}
94
102
#[ cfg( windows) ]
0 commit comments