aboutsummaryrefslogtreecommitdiffstats
path: root/src/pty/std.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-12-14 18:11:04 -0500
committerJesse Luehrs <doy@tozt.net>2021-12-14 18:12:21 -0500
commit38070766d15c44c3d731aa5b231e3b2ad698ac05 (patch)
tree9ea168b1ae5a6e5c0818eb058c342e79a8482c8a /src/pty/std.rs
parentae7718447d24ea0517e7154873c2b55fdd89538d (diff)
downloadpty-process-38070766d15c44c3d731aa5b231e3b2ad698ac05.tar.gz
pty-process-38070766d15c44c3d731aa5b231e3b2ad698ac05.zip
simplify error handling a bunch
Diffstat (limited to 'src/pty/std.rs')
-rw-r--r--src/pty/std.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/pty/std.rs b/src/pty/std.rs
index 612c9b6..c907052 100644
--- a/src/pty/std.rs
+++ b/src/pty/std.rs
@@ -34,14 +34,12 @@ impl super::Pty for Pty {
.read(true)
.write(true)
.open(&self.ptsname)
- .map_err(|e| {
- crate::error::Error::OpenPts(e, self.ptsname.clone())
- })?;
+ .map_err(crate::error::create_pty)?;
Ok(fh)
}
fn resize(&self, size: &super::Size) -> crate::error::Result<()> {
super::set_term_size(self.pt().as_raw_fd(), size)
- .map_err(crate::error::Error::SetTermSize)
+ .map_err(crate::error::set_term_size)
}
}