diff options
author | Jesse Luehrs <doy@tozt.net> | 2023-03-08 00:39:55 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2023-03-08 00:39:55 -0500 |
commit | 7378dfbc0052dcda076cd3242f29d31eab265566 (patch) | |
tree | adeffc194766f0d44e47351bc23ea2ffb2d1a017 /src/pty.rs | |
parent | 959af70ee832299101826a5bda41cb99cb7cd50d (diff) | |
download | pty-process-7378dfbc0052dcda076cd3242f29d31eab265566.tar.gz pty-process-7378dfbc0052dcda076cd3242f29d31eab265566.zip |
use the new fd apis in std
Diffstat (limited to 'src/pty.rs')
-rw-r--r-- | src/pty.rs | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -59,9 +59,15 @@ impl Pty { } } -impl std::os::unix::io::AsRawFd for Pty { - fn as_raw_fd(&self) -> std::os::unix::io::RawFd { - self.0.as_raw_fd() +impl From<Pty> for std::os::fd::OwnedFd { + fn from(pty: Pty) -> Self { + pty.0.into_inner().into() + } +} + +impl std::os::fd::AsFd for Pty { + fn as_fd(&self) -> std::os::fd::BorrowedFd<'_> { + self.0.get_ref().as_fd() } } |