This commit is contained in:
whitequark 2017-02-04 16:23:18 +00:00
parent 3eef0bcc1a
commit f94028b8df
1 changed files with 6 additions and 0 deletions

View File

@ -21,6 +21,12 @@ mod cslice {
phantom: PhantomData<&'a ()>
}
impl<'a, T> CSlice<'a, T> {
pub fn len(&self) -> usize {
self.len as usize
}
}
impl<'a, T> AsRef<[T]> for CSlice<'a, T> {
fn as_ref(&self) -> &[T] {
unsafe {