diff options
| author | Jorge Aparicio <japaricious@gmail.com> | 2016-03-22 22:01:37 -0500 |
|---|---|---|
| committer | Jorge Aparicio <japaricious@gmail.com> | 2016-03-22 22:01:37 -0500 |
| commit | 0f02309e4b0ea05ee905205278fb6d131341c41f (patch) | |
| tree | a259129eeb84705de15b51587ddebd0f82735075 /src/libstd/sys/unix/pipe.rs | |
| parent | 0dcc413e42f15f4fc51a0ca88a99cc89454ec43d (diff) | |
| download | rust-0f02309e4b0ea05ee905205278fb6d131341c41f.tar.gz rust-0f02309e4b0ea05ee905205278fb6d131341c41f.zip | |
try! -> ?
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
Diffstat (limited to 'src/libstd/sys/unix/pipe.rs')
| -rw-r--r-- | src/libstd/sys/unix/pipe.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/sys/unix/pipe.rs b/src/libstd/sys/unix/pipe.rs index e5cb3761001..beca2d46753 100644 --- a/src/libstd/sys/unix/pipe.rs +++ b/src/libstd/sys/unix/pipe.rs @@ -87,13 +87,13 @@ pub fn read2(p1: AnonPipe, let max = cmp::max(p1.raw(), p2.raw()); loop { // wait for either pipe to become readable using `select` - try!(cvt_r(|| unsafe { + cvt_r(|| unsafe { let mut read: libc::fd_set = mem::zeroed(); libc::FD_SET(p1.raw(), &mut read); libc::FD_SET(p2.raw(), &mut read); libc::select(max + 1, &mut read, 0 as *mut _, 0 as *mut _, 0 as *mut _) - })); + })?; // Read as much as we can from each pipe, ignoring EWOULDBLOCK or // EAGAIN. If we hit EOF, then this will happen because the underlying @@ -113,11 +113,11 @@ pub fn read2(p1: AnonPipe, } } }; - if try!(read(&p1, v1)) { + if read(&p1, v1)? { p2.set_nonblocking(false); return p2.read_to_end(v2).map(|_| ()); } - if try!(read(&p2, v2)) { + if read(&p2, v2)? { p1.set_nonblocking(false); return p1.read_to_end(v1).map(|_| ()); } |
