Merge pull request #136 from tbu-/pr_asptr

Add `as_{,mut_}ptr` functions to `ArrayVec`, mirroring `Vec`
This commit is contained in:
bluss
2019-10-05 21:11:11 +02:00
committed by GitHub
+10
View File
@@ -643,6 +643,16 @@ impl<A: Array> ArrayVec<A> {
pub fn as_mut_slice(&mut self) -> &mut [A::Item] {
self
}
/// Return a raw pointer to the vector's buffer.
pub fn as_ptr(&self) -> *const A::Item {
self.xs.ptr()
}
/// Return a raw mutable pointer to the vector's buffer.
pub fn as_mut_ptr(&mut self) -> *mut A::Item {
self.xs.ptr_mut()
}
}
impl<A: Array> Deref for ArrayVec<A> {