From 86cc98e343b8413104b004ecdab705de9acf8e1b Mon Sep 17 00:00:00 2001 From: oech3 <> Date: Tue, 9 Jun 2026 19:02:29 +0900 Subject: [PATCH] tail: remove unnecessary .as_fd() --- src/uu/tail/src/tail.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/uu/tail/src/tail.rs b/src/uu/tail/src/tail.rs index b0e2bf629..2026c8902 100644 --- a/src/uu/tail/src/tail.rs +++ b/src/uu/tail/src/tail.rs @@ -221,7 +221,6 @@ fn tail_file( fn open_file(path: &Path, use_nonblock_for_fifo: bool) -> io::Result { use rustix::fs::{OFlags, fcntl_getfl, fcntl_setfl}; use std::fs::OpenOptions; - use std::os::fd::AsFd; use std::os::unix::fs::{FileTypeExt, OpenOptionsExt}; let is_fifo = path.metadata().is_ok_and(|m| m.file_type().is_fifo()); @@ -233,9 +232,9 @@ fn open_file(path: &Path, use_nonblock_for_fifo: bool) -> io::Result { .open(path)?; // Clear O_NONBLOCK so reads block normally - let flags = fcntl_getfl(file.as_fd())?; + let flags = fcntl_getfl(&file)?; let new_flags = flags & !OFlags::NONBLOCK; - fcntl_setfl(file.as_fd(), new_flags)?; + fcntl_setfl(&file, new_flags)?; Ok(file) } else {