Rollup merge of #76760 - matthiaskrgr:clippy_lazy_eval, r=varkor

don't lazily evaluate some trivial values for Option::None replacements (clippy::unnecessary_lazy_evaluations)
This commit is contained in:
Tyler Mandry 2020-09-16 12:24:23 -07:00 committed by GitHub
commit 6e0131cd5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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| {

View File

@ -170,7 +170,7 @@ fn register_native_lib(&mut self, span: Option<Span>, lib: NativeLib) {
feature_err(
&self.tcx.sess.parse_sess,
sym::static_nobundle,
span.unwrap_or_else(|| rustc_span::DUMMY_SP),
span.unwrap_or(rustc_span::DUMMY_SP),
"kind=\"static-nobundle\" is unstable",
)
.emit();
@ -179,7 +179,7 @@ fn register_native_lib(&mut self, span: Option<Span>, lib: NativeLib) {
feature_err(
&self.tcx.sess.parse_sess,
sym::raw_dylib,
span.unwrap_or_else(|| rustc_span::DUMMY_SP),
span.unwrap_or(rustc_span::DUMMY_SP),
"kind=\"raw-dylib\" is unstable",
)
.emit();