mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 03:24:47 +08:00
Add AsFd impl for AutoCloseFd
Will be used to remove RawFd usages.
This commit is contained in:
parent
4e50ae34da
commit
c0d68084f7
|
@ -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 New Issue
Block a user