mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
match_like_matches_macro
This commit is contained in:
parent
2ae2512378
commit
add40c8660
9 changed files with 29 additions and 43 deletions
|
@ -2495,14 +2495,7 @@ impl Trait {
|
|||
db.generic_params(GenericDefId::from(self.id))
|
||||
.type_or_consts
|
||||
.iter()
|
||||
.filter(|(_, ty)| match ty {
|
||||
TypeOrConstParamData::TypeParamData(ty)
|
||||
if ty.provenance != TypeParamProvenance::TypeParamList =>
|
||||
{
|
||||
false
|
||||
}
|
||||
_ => true,
|
||||
})
|
||||
.filter(|(_, ty)| !matches!(ty, TypeOrConstParamData::TypeParamData(ty) if ty.provenance != TypeParamProvenance::TypeParamList))
|
||||
.filter(|(_, ty)| !count_required_only || !ty.has_default())
|
||||
.count()
|
||||
}
|
||||
|
@ -3872,10 +3865,7 @@ impl Type {
|
|||
}
|
||||
|
||||
pub fn is_int_or_uint(&self) -> bool {
|
||||
match self.ty.kind(Interner) {
|
||||
TyKind::Scalar(Scalar::Int(_) | Scalar::Uint(_)) => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(self.ty.kind(Interner), TyKind::Scalar(Scalar::Int(_) | Scalar::Uint(_)))
|
||||
}
|
||||
|
||||
pub fn is_scalar(&self) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue