From 38070766d15c44c3d731aa5b231e3b2ad698ac05 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 14 Dec 2021 18:11:04 -0500 Subject: simplify error handling a bunch --- src/pty.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/pty.rs') diff --git a/src/pty.rs b/src/pty.rs index fde86b1..a569f88 100644 --- a/src/pty.rs +++ b/src/pty.rs @@ -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(); -- cgit v1.2.3-54-g00ecf