1
Fork 0

Rollup merge of #80327 - PankajChaudhary5:PankajChaudhary, r=GuillaumeGomez

Updated the match with the matches macro

r?````@GuillaumeGomez````
This commit is contained in:
Dylan DPC 2020-12-25 03:39:43 +01:00 committed by GitHub
commit 2dab627d77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -215,10 +215,7 @@ pub enum TyKind<'tcx> {
impl TyKind<'tcx> { impl TyKind<'tcx> {
#[inline] #[inline]
pub fn is_primitive(&self) -> bool { pub fn is_primitive(&self) -> bool {
match self { matches!(self, Bool | Char | Int(_) | Uint(_) | Float(_))
Bool | Char | Int(_) | Uint(_) | Float(_) => true,
_ => false,
}
} }
/// Get the article ("a" or "an") to use with this type. /// Get the article ("a" or "an") to use with this type.