Fix clippy: match expression looks like matches!
macro
This commit is contained in:
parent
fb1fdc8aed
commit
ee2223fa13
@ -30,10 +30,7 @@ enum CDeclarator {
|
||||
|
||||
impl CDeclarator {
|
||||
fn is_ptr(&self) -> bool {
|
||||
match self {
|
||||
CDeclarator::Ptr { .. } | CDeclarator::Func { .. } => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(self, CDeclarator::Ptr { .. } | CDeclarator::Func { .. })
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -300,10 +300,7 @@ impl PrimitiveType {
|
||||
}
|
||||
|
||||
fn can_cmp_order(&self) -> bool {
|
||||
match *self {
|
||||
PrimitiveType::Bool => false,
|
||||
_ => true,
|
||||
}
|
||||
!matches!(*self, PrimitiveType::Bool)
|
||||
}
|
||||
|
||||
fn can_cmp_eq(&self) -> bool {
|
||||
@ -551,10 +548,7 @@ impl Type {
|
||||
pub fn is_primitive_or_ptr_primitive(&self) -> bool {
|
||||
match *self {
|
||||
Type::Primitive(..) => true,
|
||||
Type::Ptr { ref ty, .. } => match ty.as_ref() {
|
||||
Type::Primitive(..) => true,
|
||||
_ => false,
|
||||
},
|
||||
Type::Ptr { ref ty, .. } => matches!(ty.as_ref(), Type::Primitive(..)),
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
@ -515,10 +515,10 @@ impl Parse {
|
||||
self.load_syn_ty(crate_name, mod_cfg, item);
|
||||
}
|
||||
syn::Item::Impl(ref item_impl) => {
|
||||
let has_assoc_const = item_impl.items.iter().any(|item| match item {
|
||||
syn::ImplItem::Const(_) => true,
|
||||
_ => false,
|
||||
});
|
||||
let has_assoc_const = item_impl
|
||||
.items
|
||||
.iter()
|
||||
.any(|item| matches!(item, syn::ImplItem::Const(_)));
|
||||
if has_assoc_const {
|
||||
impls_with_assoc_consts.push(item_impl);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user