1
Fork 0

use matches! macro in more places

This commit is contained in:
Matthias Krüger 2023-04-15 20:49:54 +02:00
parent e6e956dade
commit bcc15bba95
13 changed files with 52 additions and 75 deletions

View file

@ -234,10 +234,7 @@ impl DefKind {
#[inline]
pub fn is_fn_like(self) -> bool {
match self {
DefKind::Fn | DefKind::AssocFn | DefKind::Closure | DefKind::Generator => true,
_ => false,
}
matches!(self, DefKind::Fn | DefKind::AssocFn | DefKind::Closure | DefKind::Generator)
}
/// Whether `query get_codegen_attrs` should be used with this definition.