1
Fork 0

Adopt let else in more places

This commit is contained in:
est31 2022-02-19 00:48:49 +01:00
parent b8c56fa8c3
commit 2ef8af6619
132 changed files with 539 additions and 881 deletions

View file

@ -635,9 +635,8 @@ pub struct WhereBoundPredicate<'hir> {
impl<'hir> WhereBoundPredicate<'hir> {
/// Returns `true` if `param_def_id` matches the `bounded_ty` of this predicate.
pub fn is_param_bound(&self, param_def_id: DefId) -> bool {
let path = match self.bounded_ty.kind {
TyKind::Path(QPath::Resolved(None, path)) => path,
_ => return false,
let TyKind::Path(QPath::Resolved(None, path)) = self.bounded_ty.kind else {
return false;
};
match path.res {
Res::Def(DefKind::TyParam, def_id)

View file

@ -5,6 +5,7 @@
#![feature(associated_type_defaults)]
#![feature(const_btree_new)]
#![feature(crate_visibility_modifier)]
#![feature(let_else)]
#![feature(once_cell)]
#![feature(min_specialization)]
#![feature(never_type)]