diff options
| author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2024-03-25 21:29:42 +0100 |
|---|---|---|
| committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2024-03-26 15:58:00 +0100 |
| commit | 7b4e5079619f99a1bff8a2f388b498be5687d280 (patch) | |
| tree | 24e0a36b0f3930692e0c5b5779c1c391c5b627ed | |
| parent | 60b5ca62752ecc25d578066c8b82e1a4887267d4 (diff) | |
| download | rust-7b4e5079619f99a1bff8a2f388b498be5687d280.tar.gz rust-7b4e5079619f99a1bff8a2f388b498be5687d280.zip | |
unix fs: Make hurd and horizon using explicit new rather than From
408c0ea2162b ("unix time module now return result") dropped the From
impl for SystemTime, breaking the hurd and horizon builds.
Fixes #123032
| -rw-r--r-- | library/std/src/sys/pal/unix/fs.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/sys/pal/unix/fs.rs b/library/std/src/sys/pal/unix/fs.rs index b968f8df34c..99b6da60c14 100644 --- a/library/std/src/sys/pal/unix/fs.rs +++ b/library/std/src/sys/pal/unix/fs.rs @@ -517,7 +517,7 @@ impl FileAttr { #[cfg(any(target_os = "horizon", target_os = "hurd"))] pub fn modified(&self) -> io::Result<SystemTime> { - Ok(SystemTime::from(self.stat.st_mtim)) + SystemTime::new(self.stat.st_mtim.tv_sec as i64, self.stat.st_mtim.tv_nsec as i64) } #[cfg(not(any( @@ -545,7 +545,7 @@ impl FileAttr { #[cfg(any(target_os = "horizon", target_os = "hurd"))] pub fn accessed(&self) -> io::Result<SystemTime> { - Ok(SystemTime::from(self.stat.st_atim)) + SystemTime::new(self.stat.st_atim.tv_sec as i64, self.stat.st_atim.tv_nsec as i64) } #[cfg(any( |
