Skip to content

Commit 20c4fff

Browse files
committed
simplify at_rawfd()
1 parent 613239d commit 20c4fff

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/fcntl.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,7 @@ libc_bitflags!(
223223
all(feature = "process", any(target_os = "android", target_os = "linux"))
224224
))]
225225
pub(crate) fn at_rawfd(fd: Option<RawFd>) -> raw::c_int {
226-
match fd {
227-
None => libc::AT_FDCWD,
228-
Some(fd) => fd,
229-
}
226+
fd.unwrap_or(libc::AT_FDCWD)
230227
}
231228

232229
feature! {

0 commit comments

Comments
 (0)