Use is_some_and
/is_ok_and
in less obvious spots
This commit is contained in:
parent
fb0f74a8c9
commit
307799a711
19 changed files with 53 additions and 88 deletions
|
@ -383,9 +383,8 @@ impl LateLintPass<'_> for Diagnostics {
|
|||
debug!(?span, ?def_id, ?substs);
|
||||
let has_attr = ty::Instance::resolve(cx.tcx, cx.param_env, def_id, substs)
|
||||
.ok()
|
||||
.and_then(|inst| inst)
|
||||
.map(|inst| cx.tcx.has_attr(inst.def_id(), sym::rustc_lint_diagnostics))
|
||||
.unwrap_or(false);
|
||||
.flatten()
|
||||
.is_some_and(|inst| cx.tcx.has_attr(inst.def_id(), sym::rustc_lint_diagnostics));
|
||||
if !has_attr {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue