summaryrefslogtreecommitdiffstats
path: root/library/std/src/sys/wasi
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:25:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:25:56 +0000
commit018c4950b9406055dec02ef0fb52f132e2bb1e2c (patch)
treea835ebdf2088ef88fa681f8fad45f09922c1ae9a /library/std/src/sys/wasi
parentAdding debian version 1.75.0+dfsg1-5. (diff)
downloadrustc-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 'library/std/src/sys/wasi')
-rw-r--r--library/std/src/sys/wasi/fs.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/library/std/src/sys/wasi/fs.rs b/library/std/src/sys/wasi/fs.rs
index 437aae3ae..e82386654 100644
--- a/library/std/src/sys/wasi/fs.rs
+++ b/library/std/src/sys/wasi/fs.rs
@@ -477,12 +477,13 @@ impl File {
}
pub fn set_times(&self, times: FileTimes) -> io::Result<()> {
- let to_timestamp = |time: Option<SystemTime>| {
- match time {
- Some(time) if let Some(ts) = time.to_wasi_timestamp() => Ok(ts),
- Some(_) => Err(io::const_io_error!(io::ErrorKind::InvalidInput, "timestamp is too large to set as a file time")),
- None => Ok(0),
- }
+ let to_timestamp = |time: Option<SystemTime>| match time {
+ Some(time) if let Some(ts) = time.to_wasi_timestamp() => Ok(ts),
+ Some(_) => Err(io::const_io_error!(
+ io::ErrorKind::InvalidInput,
+ "timestamp is too large to set as a file time"
+ )),
+ None => Ok(0),
};
self.fd.filestat_set_times(
to_timestamp(times.accessed)?,