summaryrefslogtreecommitdiff
path: root/src/pty.rs
diff options
context:
space:
mode:
authorBryant Mairs <bryantmairs@google.com>2017-12-16 09:19:14 -0800
committerBryant Mairs <bryantmairs@google.com>2017-12-20 07:05:04 -0800
commit0691ed1383ad50b9cf0d95561b908b7fadf2295e (patch)
treeab1a3c05876959828655402e79309d8cfb1925a3 /src/pty.rs
parent9acfff7ab09fd83246a057b6b06bd0a3834b1fe5 (diff)
downloadnix-0691ed1383ad50b9cf0d95561b908b7fadf2295e.zip
Remove unnecessary .into()
Diffstat (limited to 'src/pty.rs')
-rw-r--r--src/pty.rs10
1 files changed, 5 insertions, 5 deletions
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<PtyMaster> {
};
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<PtyMaster> {
pub unsafe fn ptsname(fd: &PtyMaster) -> Result<String> {
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<String> {
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<String> {
#[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(())