From 569676b9b05cd150da3dadcd886cbbf5b40c4fce Mon Sep 17 00:00:00 2001 From: Matthias Krüger Date: Wed, 4 Mar 2020 15:13:19 +0100 Subject: Use .map() to modify data inside Options instead of using .and_then(|x| Some(y)) (clippy::option_and_then_some) --- src/librustc_parse/parser/attr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/librustc_parse/parser') diff --git a/src/librustc_parse/parser/attr.rs b/src/librustc_parse/parser/attr.rs index c5f8b2dd862..2dccb04f6cc 100644 --- a/src/librustc_parse/parser/attr.rs +++ b/src/librustc_parse/parser/attr.rs @@ -37,7 +37,7 @@ impl<'a> Parser<'a> { let inner_parse_policy = InnerAttributeParsePolicy::NotPermitted { reason: inner_error_reason, saw_doc_comment: just_parsed_doc_comment, - prev_attr_sp: attrs.last().and_then(|a| Some(a.span)), + prev_attr_sp: attrs.last().map(|a| a.span), }; let attr = self.parse_attribute_with_inner_parse_policy(inner_parse_policy)?; attrs.push(attr); -- cgit 1.4.1-3-g733a5