summary refs log tree commit diff
path: root/src/libsyntax/parse/attr.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/libsyntax/parse/attr.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/libsyntax/parse/attr.rs')
-rw-r--r--src/libsyntax/parse/attr.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs
index 0950d6082e7..b8e320e36e9 100644
--- a/src/libsyntax/parse/attr.rs
+++ b/src/libsyntax/parse/attr.rs
@@ -25,7 +25,7 @@ impl<'a> Parser<'a> {
             debug!("parse_outer_attributes: self.token={:?}", self.token);
             match self.token {
                 token::Pound => {
-                    attrs.push(try!(self.parse_attribute(false)));
+                    attrs.push(self.parse_attribute(false)?);
                 }
                 token::DocComment(s) => {
                     let attr = ::attr::mk_sugared_doc_attr(
@@ -79,10 +79,10 @@ impl<'a> Parser<'a> {
                     ast::AttrStyle::Outer
                 };
 
-                try!(self.expect(&token::OpenDelim(token::Bracket)));
-                let meta_item = try!(self.parse_meta_item());
+                self.expect(&token::OpenDelim(token::Bracket))?;
+                let meta_item = self.parse_meta_item()?;
                 let hi = self.span.hi;
-                try!(self.expect(&token::CloseDelim(token::Bracket)));
+                self.expect(&token::CloseDelim(token::Bracket))?;
 
                 (mk_sp(lo, hi), meta_item, style)
             }
@@ -126,7 +126,7 @@ impl<'a> Parser<'a> {
                         break;
                     }
 
-                    let attr = try!(self.parse_attribute(true));
+                    let attr = self.parse_attribute(true)?;
                     assert!(attr.node.style == ast::AttrStyle::Inner);
                     attrs.push(attr);
                 }
@@ -166,12 +166,12 @@ impl<'a> Parser<'a> {
         }
 
         let lo = self.span.lo;
-        let ident = try!(self.parse_ident());
+        let ident = self.parse_ident()?;
         let name = self.id_to_interned_str(ident);
         match self.token {
             token::Eq => {
                 self.bump();
-                let lit = try!(self.parse_lit());
+                let lit = self.parse_lit()?;
                 // FIXME #623 Non-string meta items are not serialized correctly;
                 // just forbid them for now
                 match lit.node {
@@ -185,7 +185,7 @@ impl<'a> Parser<'a> {
                 Ok(P(spanned(lo, hi, ast::MetaItemKind::NameValue(name, lit))))
             }
             token::OpenDelim(token::Paren) => {
-                let inner_items = try!(self.parse_meta_seq());
+                let inner_items = self.parse_meta_seq()?;
                 let hi = self.span.hi;
                 Ok(P(spanned(lo, hi, ast::MetaItemKind::List(name, inner_items))))
             }