about summary refs log tree commit diff
path: root/src/libsyntax/diagnostics
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/libsyntax/diagnostics
parent0dcc413e42f15f4fc51a0ca88a99cc89454ec43d (diff)
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/libsyntax/diagnostics')
-rw-r--r--src/libsyntax/diagnostics/metadata.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/diagnostics/metadata.rs b/src/libsyntax/diagnostics/metadata.rs
index e988b74cb3d..181b32594f1 100644
--- a/src/libsyntax/diagnostics/metadata.rs
+++ b/src/libsyntax/diagnostics/metadata.rs
@@ -76,11 +76,11 @@ pub fn output_metadata(ecx: &ExtCtxt, prefix: &str, name: &str, err_map: &ErrorM
 {
     // Create the directory to place the file in.
     let metadata_dir = get_metadata_dir(prefix);
-    try!(create_dir_all(&metadata_dir));
+    create_dir_all(&metadata_dir)?;
 
     // Open the metadata file.
     let metadata_path = get_metadata_path(metadata_dir, name);
-    let mut metadata_file = try!(File::create(&metadata_path));
+    let mut metadata_file = File::create(&metadata_path)?;
 
     // Construct a serializable map.
     let json_map = err_map.iter().map(|(k, &ErrorInfo { description, use_site })| {
@@ -95,7 +95,7 @@ pub fn output_metadata(ecx: &ExtCtxt, prefix: &str, name: &str, err_map: &ErrorM
     // Write the data to the file, deleting it if the write fails.
     let result = write!(&mut metadata_file, "{}", as_json(&json_map));
     if result.is_err() {
-        try!(remove_file(&metadata_path));
+        remove_file(&metadata_path)?;
     }
-    Ok(try!(result))
+    Ok(result?)
 }