From 0691ed1383ad50b9cf0d95561b908b7fadf2295e Mon Sep 17 00:00:00 2001 From: Bryant Mairs Date: Sat, 16 Dec 2017 09:19:14 -0800 Subject: Remove unnecessary .into() --- src/pty.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/pty.rs') diff --git a/src/pty.rs b/src/pty.rs index d526ed17..09c30cf4 100644 --- a/src/pty.rs +++ b/src/pty.rs @@ -69,7 +69,7 @@ impl Drop for PtyMaster { #[inline] pub fn grantpt(fd: &PtyMaster) -> Result<()> { if unsafe { libc::grantpt(fd.as_raw_fd()) } < 0 { - return Err(Error::last().into()); + return Err(Error::last()); } Ok(()) @@ -116,7 +116,7 @@ pub fn posix_openpt(flags: fcntl::OFlag) -> Result { }; if fd < 0 { - return Err(Error::last().into()); + return Err(Error::last()); } Ok(PtyMaster(fd)) @@ -142,7 +142,7 @@ pub fn posix_openpt(flags: fcntl::OFlag) -> Result { pub unsafe fn ptsname(fd: &PtyMaster) -> Result { let name_ptr = libc::ptsname(fd.as_raw_fd()); if name_ptr.is_null() { - return Err(Error::last().into()); + return Err(Error::last()); } let name = CStr::from_ptr(name_ptr); @@ -164,7 +164,7 @@ pub fn ptsname_r(fd: &PtyMaster) -> Result { let mut name_buf = vec![0u8; 64]; let name_buf_ptr = name_buf.as_mut_ptr() as *mut libc::c_char; if unsafe { libc::ptsname_r(fd.as_raw_fd(), name_buf_ptr, name_buf.capacity()) } != 0 { - return Err(Error::last().into()); + return Err(Error::last()); } // Find the first null-character terminating this string. This is guaranteed to succeed if the @@ -185,7 +185,7 @@ pub fn ptsname_r(fd: &PtyMaster) -> Result { #[inline] pub fn unlockpt(fd: &PtyMaster) -> Result<()> { if unsafe { libc::unlockpt(fd.as_raw_fd()) } < 0 { - return Err(Error::last().into()); + return Err(Error::last()); } Ok(()) -- cgit v1.2.3