about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorMatt Brubeck <mbrubeck@limpet.net>2017-12-08 17:32:04 -0800
committerMatt Brubeck <mbrubeck@limpet.net>2017-12-09 14:18:33 -0800
commit3024c1434a667425d30e4b0785857381323712aa (patch)
tree97e25cbc974f2a552c2314a2da2e216c358fb141 /src/libsyntax/parse
parentc7b6d8263b0c106503d102ab8148769ac9f7d086 (diff)
downloadrust-3024c1434a667425d30e4b0785857381323712aa.tar.gz
rust-3024c1434a667425d30e4b0785857381323712aa.zip
Use Try syntax for Option in place of macros or match
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/token.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index ff87f146c0a..26f39f60880 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -620,10 +620,7 @@ fn prepend_attrs(sess: &ParseSess,
                  span: syntax_pos::Span)
     -> Option<tokenstream::TokenStream>
 {
-    let tokens = match tokens {
-        Some(tokens) => tokens,
-        None => return None,
-    };
+    let tokens = tokens?;
     if attrs.len() == 0 {
         return Some(tokens.clone())
     }