mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
add is_slice
method to hir::Type
This commit is contained in:
parent
1f5f4ccfb1
commit
a5ab6a2f75
1 changed files with 4 additions and 0 deletions
|
@ -2507,6 +2507,10 @@ impl Type {
|
|||
matches!(self.ty.kind(Interner), TyKind::Ref(..))
|
||||
}
|
||||
|
||||
pub fn is_slice(&self) -> bool {
|
||||
matches!(self.ty.kind(Interner), TyKind::Slice(..))
|
||||
}
|
||||
|
||||
pub fn is_usize(&self) -> bool {
|
||||
matches!(self.ty.kind(Interner), TyKind::Scalar(Scalar::Uint(UintTy::Usize)))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue