diff options
author | Felix Kronlage <kronlage@bytemine.net> | 2015-07-07 16:21:21 +0200 |
---|---|---|
committer | Carl Lerche <me@carllerche.com> | 2015-07-07 11:06:53 -0700 |
commit | 032a29ec186c2dfd65a93b346c89917d9aea26a7 (patch) | |
tree | 53f853ce29f5d5cec8b1c1548e0aed5dba6fc159 /src/unistd.rs | |
parent | e3d840fdd8cf64987e97ada0c473a8d7d918bf99 (diff) | |
download | nix-032a29ec186c2dfd65a93b346c89917d9aea26a7.zip |
remove unneeded mut.
nightly will comment this with:
---
src/unistd.rs:241:13: 241:20 error: variable does not need to be mutable, #[deny(unused_mut)] on by default
src/unistd.rs:241 let mut res;
---
Diffstat (limited to 'src/unistd.rs')
-rw-r--r-- | src/unistd.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/unistd.rs b/src/unistd.rs index 4181ccd8..f540e29b 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -224,10 +224,9 @@ pub fn write(fd: RawFd, buf: &[u8]) -> Result<usize> { pub fn pipe() -> Result<(RawFd, RawFd)> { unsafe { - let mut res; let mut fds: [c_int; 2] = mem::uninitialized(); - res = ffi::pipe(fds.as_mut_ptr()); + let res = ffi::pipe(fds.as_mut_ptr()); if res < 0 { return Err(Error::Sys(Errno::last())); @@ -239,10 +238,9 @@ pub fn pipe() -> Result<(RawFd, RawFd)> { pub fn pipe2(flags: OFlag) -> Result<(RawFd, RawFd)> { unsafe { - let mut res; let mut fds: [c_int; 2] = mem::uninitialized(); - res = ffi::pipe(fds.as_mut_ptr()); + let res = ffi::pipe(fds.as_mut_ptr()); if res < 0 { return Err(Error::Sys(Errno::last())); |