Fix warnings in stubbed out set_times

This commit is contained in:
Josh Triplett 2022-07-30 13:28:17 -07:00
parent 11d9be6359
commit f8061ddb03

View file

@ -1071,10 +1071,11 @@ impl File {
cfg_if::cfg_if! { cfg_if::cfg_if! {
if #[cfg(target_os = "redox")] { if #[cfg(target_os = "redox")] {
// Redox doesn't appear to support `UTIME_OMIT`. // Redox doesn't appear to support `UTIME_OMIT`.
return Err(io::const_io_error!( drop(times);
Err(io::const_io_error!(
io::ErrorKind::Unsupported, io::ErrorKind::Unsupported,
"setting file times not supported", "setting file times not supported",
)); ))
} else if #[cfg(any(target_os = "android", target_os = "macos"))] { } else if #[cfg(any(target_os = "android", target_os = "macos"))] {
// futimens requires macOS 10.13, and Android API level 19 // futimens requires macOS 10.13, and Android API level 19
cvt(unsafe { cvt(unsafe {
@ -1100,12 +1101,12 @@ impl File {
)), )),
} }
})?; })?;
Ok(())
} else { } else {
cvt(unsafe { libc::futimens(self.as_raw_fd(), times.0.as_ptr()) })?; cvt(unsafe { libc::futimens(self.as_raw_fd(), times.0.as_ptr()) })?;
Ok(())
} }
} }
Ok(())
} }
} }