mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-19 23:21:15 -03:00
Add AsFd impl for AutoCloseFd
Will be used to remove RawFd usages.
This commit is contained in:
@@ -106,6 +106,12 @@ fn as_raw_fd(&self) -> RawFd {
|
||||
}
|
||||
}
|
||||
|
||||
impl AsFd for AutoCloseFd {
|
||||
fn as_fd(&self) -> BorrowedFd<'_> {
|
||||
unsafe { BorrowedFd::borrow_raw(self.fd()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for AutoCloseFd {
|
||||
fn default() -> AutoCloseFd {
|
||||
AutoCloseFd { fd_: -1 }
|
||||
|
||||
Reference in New Issue
Block a user