mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-12 14:51:16 -03:00
Fix some clipplies
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user