diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-12-14 18:11:04 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-12-14 18:12:21 -0500 |
commit | 38070766d15c44c3d731aa5b231e3b2ad698ac05 (patch) | |
tree | 9ea168b1ae5a6e5c0818eb058c342e79a8482c8a /src/pty.rs | |
parent | ae7718447d24ea0517e7154873c2b55fdd89538d (diff) | |
download | pty-process-38070766d15c44c3d731aa5b231e3b2ad698ac05.tar.gz pty-process-38070766d15c44c3d731aa5b231e3b2ad698ac05.zip |
simplify error handling a bunch
Diffstat (limited to 'src/pty.rs')
-rw-r--r-- | src/pty.rs | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -75,12 +75,12 @@ fn create_pt( let pt = nix::pty::posix_openpt( nix::fcntl::OFlag::O_RDWR | nix::fcntl::OFlag::O_NOCTTY, ) - .map_err(crate::error::Error::CreatePty)?; - nix::pty::grantpt(&pt).map_err(crate::error::Error::CreatePty)?; - nix::pty::unlockpt(&pt).map_err(crate::error::Error::CreatePty)?; + .map_err(crate::error::create_pty)?; + nix::pty::grantpt(&pt).map_err(crate::error::create_pty)?; + nix::pty::unlockpt(&pt).map_err(crate::error::create_pty)?; let ptsname = nix::pty::ptsname_r(&pt) - .map_err(crate::error::Error::CreatePty)? + .map_err(crate::error::create_pty)? .into(); let pt_fd = pt.into_raw_fd(); |