Skip to content

Commit a5ab6a2

Browse files
committed
add is_slice method to hir::Type
1 parent 1f5f4cc commit a5ab6a2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/hir/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2507,6 +2507,10 @@ impl Type {
25072507
matches!(self.ty.kind(Interner), TyKind::Ref(..))
25082508
}
25092509

2510+
pub fn is_slice(&self) -> bool {
2511+
matches!(self.ty.kind(Interner), TyKind::Slice(..))
2512+
}
2513+
25102514
pub fn is_usize(&self) -> bool {
25112515
matches!(self.ty.kind(Interner), TyKind::Scalar(Scalar::Uint(UintTy::Usize)))
25122516
}

0 commit comments

Comments
 (0)