diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:25:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:25:56 +0000 |
commit | 018c4950b9406055dec02ef0fb52f132e2bb1e2c (patch) | |
tree | a835ebdf2088ef88fa681f8fad45f09922c1ae9a /vendor/filetime/src/unix | |
parent | Adding debian version 1.75.0+dfsg1-5. (diff) | |
download | rustc-018c4950b9406055dec02ef0fb52f132e2bb1e2c.tar.xz rustc-018c4950b9406055dec02ef0fb52f132e2bb1e2c.zip |
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/filetime/src/unix')
-rw-r--r-- | vendor/filetime/src/unix/mod.rs | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/vendor/filetime/src/unix/mod.rs b/vendor/filetime/src/unix/mod.rs index df62de429..f5a48b29d 100644 --- a/vendor/filetime/src/unix/mod.rs +++ b/vendor/filetime/src/unix/mod.rs @@ -85,34 +85,17 @@ pub fn from_last_access_time(meta: &fs::Metadata) -> FileTime { } pub fn from_creation_time(meta: &fs::Metadata) -> Option<FileTime> { - macro_rules! birthtim { - ($(($e:expr, $i:ident)),*) => { - #[cfg(any($(target_os = $e),*))] - fn imp(meta: &fs::Metadata) -> Option<FileTime> { - $( - #[cfg(target_os = $e)] - use std::os::$i::fs::MetadataExt; - )* - Some(FileTime { - seconds: meta.st_birthtime(), - nanos: meta.st_birthtime_nsec() as u32, - }) - } - - #[cfg(all($(not(target_os = $e)),*))] - fn imp(_meta: &fs::Metadata) -> Option<FileTime> { - None - } - } + #[cfg(target_os = "bitrig")] + { + use std::os::bitrig::fs::MetadataExt; + Some(FileTime { + seconds: meta.st_birthtime(), + nanos: meta.st_birthtime_nsec() as u32, + }) } - birthtim! { - ("bitrig", bitrig), - ("freebsd", freebsd), - ("ios", ios), - ("macos", macos), - ("openbsd", openbsd) + #[cfg(not(target_os = "bitrig"))] + { + meta.created().map(|i| i.into()).ok() } - - imp(meta) } |