Use .map() to modify data inside Options instead of using .and_then(|x| Some(y)) (clippy::option_and_then_some)

This commit is contained in:
Matthias Krüger 2020-03-04 15:13:19 +01:00
parent 07168f9cdc
commit 569676b9b0
4 changed files with 17 additions and 22 deletions

View file

@ -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);