use matches!() macro in more places

This commit is contained in:
Matthias Krüger 2020-12-24 02:55:21 +01:00
parent c34c015fe2
commit d12a358673
34 changed files with 138 additions and 270 deletions

View file

@ -256,10 +256,7 @@ impl<'a> Visitor<'a> for CollectProcMacros<'a> {
// we're just not interested in this item.
//
// If we find one, try to locate a `#[proc_macro_derive]` attribute on it.
let is_fn = match item.kind {
ast::ItemKind::Fn(..) => true,
_ => false,
};
let is_fn = matches!(item.kind, ast::ItemKind::Fn(..));
let mut found_attr: Option<&'a ast::Attribute> = None;