Skip to content

Commit 1c5c8ca

Browse files
chenyukangjoshtriplett
authored andcommitted
use proper unsupported
1 parent 6308e76 commit 1c5c8ca

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -539,14 +539,11 @@ pub fn set_perm(p: &Path, perm: FilePermissions) -> io::Result<()> {
539539
}
540540

541541
pub fn set_times(_p: &Path, _times: FileTimes) -> io::Result<()> {
542-
Err(io::const_error!(io::ErrorKind::Unsupported, "setting file times not supported",))
542+
unsupported()
543543
}
544544

545545
pub fn set_times_nofollow(_p: &Path, _times: FileTimes) -> io::Result<()> {
546-
Err(io::const_error!(
547-
io::ErrorKind::Unsupported,
548-
"setting file times on symlinks not supported",
549-
))
546+
unsupported()
550547
}
551548

552549
pub fn rmdir(p: &Path) -> io::Result<()> {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,7 @@ impl fmt::Debug for OpenOptions {
12011201
target_os = "horizon",
12021202
target_os = "nuttx",
12031203
)))]
1204+
#[inline(always)]
12041205
fn to_timespec(time: Option<SystemTime>) -> io::Result<libc::timespec> {
12051206
match time {
12061207
Some(time) if let Some(ts) = time.t.to_timespec() => Ok(ts),
@@ -1217,6 +1218,7 @@ fn to_timespec(time: Option<SystemTime>) -> io::Result<libc::timespec> {
12171218
}
12181219

12191220
#[cfg(target_vendor = "apple")]
1221+
#[inline(always)]
12201222
fn set_attrlist_with_times(
12211223
times: &FileTimes,
12221224
) -> io::Result<(libc::attrlist, [mem::MaybeUninit<libc::timespec>; 3], usize)> {

0 commit comments

Comments
 (0)