Use matches!

This commit is contained in:
Florian Diebold 2020-05-08 19:30:02 +02:00
parent b60970fd20
commit f8bf94a4b9

View File

@ -731,10 +731,7 @@ impl Ty {
}
pub fn is_never(&self) -> bool {
match self {
Ty::Apply(ApplicationTy { ctor: TypeCtor::Never, .. }) => true,
_ => false,
}
matches!(self, Ty::Apply(ApplicationTy { ctor: TypeCtor::Never, .. }))
}
/// If this is a `dyn Trait` type, this returns the `Trait` part.