Skip to content

Commit 34e3ea8

Browse files
committed
feat: add remove_slice to hir::Type
1 parent 9549753 commit 34e3ea8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/hir/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3224,6 +3224,13 @@ impl Type {
32243224
}
32253225
}
32263226

3227+
pub fn remove_slice(&self) -> Option<Type> {
3228+
match &self.ty.kind(Interner) {
3229+
TyKind::Slice(ty) => Some(self.derived(ty.clone())),
3230+
_ => None,
3231+
}
3232+
}
3233+
32273234
pub fn strip_references(&self) -> Type {
32283235
self.derived(self.ty.strip_references().clone())
32293236
}

0 commit comments

Comments
 (0)