Skip to content

Commit f8061dd

Browse files
committed
Fix warnings in stubbed out set_times
1 parent 11d9be6 commit f8061dd

File tree

1 file changed

+5
-4
lines changed
  • library/std/src/sys/unix

1 file changed

+5
-4
lines changed

library/std/src/sys/unix/fs.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1071,10 +1071,11 @@ impl File {
10711071
cfg_if::cfg_if! {
10721072
if #[cfg(target_os = "redox")] {
10731073
// Redox doesn't appear to support `UTIME_OMIT`.
1074-
return Err(io::const_io_error!(
1074+
drop(times);
1075+
Err(io::const_io_error!(
10751076
io::ErrorKind::Unsupported,
10761077
"setting file times not supported",
1077-
));
1078+
))
10781079
} else if #[cfg(any(target_os = "android", target_os = "macos"))] {
10791080
// futimens requires macOS 10.13, and Android API level 19
10801081
cvt(unsafe {
@@ -1100,12 +1101,12 @@ impl File {
11001101
)),
11011102
}
11021103
})?;
1104+
Ok(())
11031105
} else {
11041106
cvt(unsafe { libc::futimens(self.as_raw_fd(), times.0.as_ptr()) })?;
1107+
Ok(())
11051108
}
11061109
}
1107-
1108-
Ok(())
11091110
}
11101111
}
11111112

0 commit comments

Comments
 (0)