We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 11d9be6 commit f8061ddCopy full SHA for f8061dd
library/std/src/sys/unix/fs.rs
@@ -1071,10 +1071,11 @@ impl File {
1071
cfg_if::cfg_if! {
1072
if #[cfg(target_os = "redox")] {
1073
// Redox doesn't appear to support `UTIME_OMIT`.
1074
- return Err(io::const_io_error!(
+ drop(times);
1075
+ Err(io::const_io_error!(
1076
io::ErrorKind::Unsupported,
1077
"setting file times not supported",
- ));
1078
+ ))
1079
} else if #[cfg(any(target_os = "android", target_os = "macos"))] {
1080
// futimens requires macOS 10.13, and Android API level 19
1081
cvt(unsafe {
@@ -1100,12 +1101,12 @@ impl File {
1100
1101
)),
1102
}
1103
})?;
1104
+ Ok(())
1105
} else {
1106
cvt(unsafe { libc::futimens(self.as_raw_fd(), times.0.as_ptr()) })?;
1107
1108
1109
-
- Ok(())
1110
1111
1112
0 commit comments