diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 6d0083c0711..27c4577d60d 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -3232,6 +3232,13 @@ pub fn remove_ref(&self) -> Option { } } + pub fn as_slice(&self) -> Option { + match &self.ty.kind(Interner) { + TyKind::Slice(ty) => Some(self.derived(ty.clone())), + _ => None, + } + } + pub fn strip_references(&self) -> Type { self.derived(self.ty.strip_references().clone()) }