diff --git a/uwb/aidl/default/src/uwb_chip.rs b/uwb/aidl/default/src/uwb_chip.rs index 2b8e481dd9..efb2454323 100644 --- a/uwb/aidl/default/src/uwb_chip.rs +++ b/uwb/aidl/default/src/uwb_chip.rs @@ -14,7 +14,6 @@ use tokio_util::sync::CancellationToken; use std::fs::{File, OpenOptions}; use std::io::{self, Read, Write}; -use std::os::fd::AsRawFd; use std::os::unix::fs::OpenOptionsExt; enum State { @@ -61,13 +60,11 @@ impl State { } pub fn makeraw(file: File) -> io::Result { - let fd = file.as_raw_fd(); - - // Configure the file descritpro as raw fd. + // Configure the file descriptor as raw fd. use nix::sys::termios::*; - let mut attrs = tcgetattr(fd)?; + let mut attrs = tcgetattr(&file)?; cfmakeraw(&mut attrs); - tcsetattr(fd, SetArg::TCSANOW, &attrs)?; + tcsetattr(&file, SetArg::TCSANOW, &attrs)?; Ok(file) }