1
Fork 0

Rollup merge of #118288 - compiler-errors:is_some_and, r=lqd,dtolnay

Use `is_{some,ok}_and` more in the compiler

slightly more fluent-reading code
This commit is contained in:
Michael Goulet 2023-11-25 17:23:34 -05:00 committed by GitHub
commit 8dd8db5073
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 21 additions and 13 deletions

View file

@ -91,7 +91,7 @@ pub(super) fn check_refining_return_position_impl_trait_in_trait<'tcx>(
// This opaque also needs to be from the impl method -- otherwise,
// it's a refinement to a TAIT.
if !tcx.hir().get_if_local(impl_opaque.def_id).map_or(false, |node| {
if !tcx.hir().get_if_local(impl_opaque.def_id).is_some_and(|node| {
matches!(
node.expect_item().expect_opaque_ty().origin,
hir::OpaqueTyOrigin::AsyncFn(def_id) | hir::OpaqueTyOrigin::FnReturn(def_id)