Expose the underlying array in addition to a ptr to the same
This commit is contained in:
parent
a5147bbf01
commit
0052bc92fb
|
@ -34,6 +34,13 @@ macro_rules! impl_array_newtype {
|
||||||
dat.as_mut_ptr()
|
dat.as_mut_ptr()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
/// Gets a reference to the underlying array
|
||||||
|
pub fn as_ref(&self) -> &[$ty; $len] {
|
||||||
|
let &$thing(ref dat) = self;
|
||||||
|
dat
|
||||||
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
/// Returns the length of the object as an array
|
/// Returns the length of the object as an array
|
||||||
pub fn len(&self) -> usize { $len }
|
pub fn len(&self) -> usize { $len }
|
||||||
|
|
Loading…
Reference in New Issue