Skip to content

Commit b7a8496

Browse files
committed
add List::as_slice
1 parent 86c6ebe commit b7a8496

File tree

1 file changed

+4
-0
lines changed
  • compiler/rustc_middle/src/ty

1 file changed

+4
-0
lines changed

compiler/rustc_middle/src/ty/list.rs

+4
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ impl<T> List<T> {
6565
pub fn len(&self) -> usize {
6666
self.len
6767
}
68+
69+
pub fn as_slice(&self) -> &[T] {
70+
self
71+
}
6872
}
6973

7074
impl<T: Copy> List<T> {

0 commit comments

Comments
 (0)