From 3024c1434a667425d30e4b0785857381323712aa Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Fri, 8 Dec 2017 17:32:04 -0800 Subject: Use Try syntax for Option in place of macros or match --- src/libsyntax/parse/token.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/libsyntax/parse') 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 { - let tokens = match tokens { - Some(tokens) => tokens, - None => return None, - }; + let tokens = tokens?; if attrs.len() == 0 { return Some(tokens.clone()) } -- cgit 1.4.1-3-g733a5