about summary refs log tree commit diff
path: root/src/libstd/ffi
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-03-23 08:59:10 -0700
committerbors <bors@rust-lang.org>2016-03-23 08:59:10 -0700
commitb76f818cad31c7910fb6f0fa5e628dbaf4db1108 (patch)
tree90110988cefffe1b4a5c104e92eae64f798d4cab /src/libstd/ffi
parent26cfc269a0ec6a7c895c38954e9701b62940df07 (diff)
parentc063c5153f778893d6d7296da1c8717ed8212bec (diff)
downloadrust-b76f818cad31c7910fb6f0fa5e628dbaf4db1108.tar.gz
rust-b76f818cad31c7910fb6f0fa5e628dbaf4db1108.zip
Auto merge of #32390 - japaric:untry, r=pnkfelix
convert 99.9% of `try!`s to `?`s

The first commit is an automated conversion using the [untry] tool and the following command:

```
$ find -name '*.rs' -type f | xargs untry
```

at the root of the Rust repo.

[untry]: https://github.com/japaric/untry

cc @rust-lang/lang @alexcrichton @brson
Diffstat (limited to 'src/libstd/ffi')
-rw-r--r--src/libstd/ffi/c_str.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs
index 1db45764552..52d7bb128d5 100644
--- a/src/libstd/ffi/c_str.rs
+++ b/src/libstd/ffi/c_str.rs
@@ -318,9 +318,9 @@ impl From<CString> for Vec<u8> {
 #[stable(feature = "cstr_debug", since = "1.3.0")]
 impl fmt::Debug for CStr {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        try!(write!(f, "\""));
+        write!(f, "\"")?;
         for byte in self.to_bytes().iter().flat_map(|&b| ascii::escape_default(b)) {
-            try!(f.write_char(byte as char));
+            f.write_char(byte as char)?;
         }
         write!(f, "\"")
     }