mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 21:33:09 +00:00
Add AsFd impl for AutoCloseFd
Will be used to remove RawFd usages.
This commit is contained in:
parent
4e50ae34da
commit
c0d68084f7
1 changed files with 6 additions and 0 deletions
|
@ -106,6 +106,12 @@ impl AsRawFd for AutoCloseFd {
|
|||
}
|
||||
}
|
||||
|
||||
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 }
|
||||
|
|
Loading…
Reference in a new issue