Fix some clipplies

This commit is contained in:
Peter Ammon
2025-12-23 08:44:10 -08:00
parent 41571dec0f
commit 5715d143a5

View File

@@ -103,9 +103,7 @@ pub fn check_readable(&mut self, timeout: Timeout) -> c_int {
&mut tvs
}
};
unsafe {
return libc::select(self.nfds_, &mut self.fdset_, null, null, timeout);
}
unsafe { libc::select(self.nfds_, &mut self.fdset_, null, null, timeout) }
}
/// Check if a single fd is readable, with a given timeout.
@@ -117,13 +115,13 @@ pub fn is_fd_readable(fd: RawFd, timeout: Timeout) -> bool {
let mut s = Self::new();
s.add(fd);
let res = s.check_readable(timeout);
return res > 0 && s.test(fd);
res > 0 && s.test(fd)
}
/// Check if a single fd is readable, without blocking.
/// Returns `true` if readable, `false` if not.
pub fn poll_fd_readable(fd: RawFd) -> bool {
return Self::is_fd_readable(fd, Timeout::ZERO);
Self::is_fd_readable(fd, Timeout::ZERO)
}
}