about summary refs log tree commit diff
path: root/src/libstd/sys/windows/stdio.rs
diff options
context:
space:
mode:
authorJorge Aparicio <japaricious@gmail.com>2016-03-22 22:01:37 -0500
committerJorge Aparicio <japaricious@gmail.com>2016-03-22 22:01:37 -0500
commit0f02309e4b0ea05ee905205278fb6d131341c41f (patch)
treea259129eeb84705de15b51587ddebd0f82735075 /src/libstd/sys/windows/stdio.rs
parent0dcc413e42f15f4fc51a0ca88a99cc89454ec43d (diff)
downloadrust-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/windows/stdio.rs')
-rw-r--r--src/libstd/sys/windows/stdio.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/sys/windows/stdio.rs b/src/libstd/sys/windows/stdio.rs
index 0a0851ffac3..fa3cab2191e 100644
--- a/src/libstd/sys/windows/stdio.rs
+++ b/src/libstd/sys/windows/stdio.rs
@@ -78,13 +78,13 @@ fn write(out: &Output, data: &[u8]) -> io::Result<usize> {
     };
     let utf16 = utf8.encode_utf16().collect::<Vec<u16>>();
     let mut written = 0;
-    try!(cvt(unsafe {
+    cvt(unsafe {
         c::WriteConsoleW(handle,
                          utf16.as_ptr() as c::LPCVOID,
                          utf16.len() as u32,
                          &mut written,
                          ptr::null_mut())
-    }));
+    })?;
 
     // FIXME if this only partially writes the utf16 buffer then we need to
     //       figure out how many bytes of `data` were actually written
@@ -112,13 +112,13 @@ impl Stdin {
         if utf8.position() as usize == utf8.get_ref().len() {
             let mut utf16 = vec![0u16; 0x1000];
             let mut num = 0;
-            try!(cvt(unsafe {
+            cvt(unsafe {
                 c::ReadConsoleW(handle,
                                 utf16.as_mut_ptr() as c::LPVOID,
                                 utf16.len() as u32,
                                 &mut num,
                                 ptr::null_mut())
-            }));
+            })?;
             utf16.truncate(num as usize);
             // FIXME: what to do about this data that has already been read?
             let data = match String::from_utf16(&utf16) {