2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-26 03:38:25 +08:00
This commit is contained in:
whitequark 2017-02-04 16:23:18 +00:00
parent 3eef0bcc1a
commit f94028b8df

View File

@ -21,6 +21,12 @@ mod cslice {
phantom: PhantomData<&'a ()> 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> { impl<'a, T> AsRef<[T]> for CSlice<'a, T> {
fn as_ref(&self) -> &[T] { fn as_ref(&self) -> &[T] {
unsafe { unsafe {