about summary refs log tree commit diff
path: root/src/librustc_parse/parser
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2020-03-04 15:13:19 +0100
committerMatthias Krüger <matthias.krueger@famsik.de>2020-03-04 20:35:11 +0100
commit569676b9b05cd150da3dadcd886cbbf5b40c4fce (patch)
tree48d34ac3b68b16b98419ec9af4729d688e809eb0 /src/librustc_parse/parser
parent07168f9cdcaae65550ea04395bef1258e8bbe9c3 (diff)
downloadrust-569676b9b05cd150da3dadcd886cbbf5b40c4fce.tar.gz
rust-569676b9b05cd150da3dadcd886cbbf5b40c4fce.zip
Use .map() to modify data inside Options instead of using .and_then(|x| Some(y)) (clippy::option_and_then_some)
Diffstat (limited to 'src/librustc_parse/parser')
-rw-r--r--src/librustc_parse/parser/attr.rs2
1 files changed, 1 insertions, 1 deletions
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);