1
Fork 0

don't lazily evaulate some trivial values for Option::None replacements (clippy::unnecessary_lazy_evaluations)

This commit is contained in:
Matthias Krüger 2020-09-15 23:10:24 +02:00
parent a874956d94
commit fd9be8f7aa
2 changed files with 3 additions and 3 deletions

View file

@ -961,7 +961,7 @@ fn warn_if_doc(cx: &EarlyContext<'_>, node_span: Span, node_kind: &str, attrs: &
continue;
}
let span = sugared_span.take().unwrap_or_else(|| attr.span);
let span = sugared_span.take().unwrap_or(attr.span);
if attr.is_doc_comment() || cx.sess().check_name(attr, sym::doc) {
cx.struct_span_lint(UNUSED_DOC_COMMENTS, span, |lint| {