mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 09:44:08 +00:00
Use matches!
This commit is contained in:
parent
b60970fd20
commit
f8bf94a4b9
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user