feat: add remove_slice to hir::Type

This commit is contained in:
Swarnim Arun 2023-03-13 16:38:26 +05:30
parent 9549753352
commit 34e3ea8cc8
No known key found for this signature in database
GPG Key ID: C4DD2E124886C2D2

View File

@ -3224,6 +3224,13 @@ pub fn remove_ref(&self) -> Option<Type> {
} }
} }
pub fn remove_slice(&self) -> Option<Type> {
match &self.ty.kind(Interner) {
TyKind::Slice(ty) => Some(self.derived(ty.clone())),
_ => None,
}
}
pub fn strip_references(&self) -> Type { pub fn strip_references(&self) -> Type {
self.derived(self.ty.strip_references().clone()) self.derived(self.ty.strip_references().clone())
} }