Use Option::is_some_and
and Result::is_ok_and
in the compiler
This commit is contained in:
parent
70db836922
commit
fb0f74a8c9
87 changed files with 148 additions and 158 deletions
|
@ -819,7 +819,7 @@ fn convert_variant(
|
|||
recovered,
|
||||
adt_kind == AdtKind::Struct && tcx.has_attr(parent_did, sym::non_exhaustive)
|
||||
|| variant_did
|
||||
.map_or(false, |variant_did| tcx.has_attr(variant_did, sym::non_exhaustive)),
|
||||
.is_some_and(|variant_did| tcx.has_attr(variant_did, sym::non_exhaustive)),
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -1025,7 +1025,7 @@ fn is_suggestable_infer_ty(ty: &hir::Ty<'_>) -> bool {
|
|||
is_suggestable_infer_ty(ty) || are_suggestable_generic_args(segment.args().args)
|
||||
}
|
||||
Path(hir::QPath::Resolved(ty_opt, hir::Path { segments, .. })) => {
|
||||
ty_opt.map_or(false, is_suggestable_infer_ty)
|
||||
ty_opt.is_some_and(is_suggestable_infer_ty)
|
||||
|| segments.iter().any(|segment| are_suggestable_generic_args(segment.args().args))
|
||||
}
|
||||
_ => false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue