mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-20 03:32:52 +00:00
add List::as_slice
This commit is contained in:
parent
86c6ebee8f
commit
b7a8496a07
@ -65,6 +65,10 @@ impl<T> List<T> {
|
||||
pub fn len(&self) -> usize {
|
||||
self.len
|
||||
}
|
||||
|
||||
pub fn as_slice(&self) -> &[T] {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Copy> List<T> {
|
||||
|
Loading…
Reference in New Issue
Block a user