Make pointer access function names match those in std
This commit is contained in:
parent
25ca567060
commit
ac2bba01cf
1 changed files with 8 additions and 4 deletions
12
src/array.rs
12
src/array.rs
|
@ -28,12 +28,14 @@ pub trait Array1 where
|
|||
type Element: Copy;
|
||||
|
||||
/// Get the pointer to the first element of the array.
|
||||
fn ptr<'a>(&'a self) -> &'a Self::Element {
|
||||
#[inline]
|
||||
fn as_ptr(&self) -> *const Self::Element {
|
||||
&self[0]
|
||||
}
|
||||
|
||||
/// Get a mutable pointer to the first element of the array.
|
||||
fn mut_ptr<'a>(&'a mut self) -> &'a mut Self::Element {
|
||||
#[inline]
|
||||
fn as_mut_ptr(&mut self) -> *mut Self::Element {
|
||||
&mut self[0]
|
||||
}
|
||||
|
||||
|
@ -74,12 +76,14 @@ pub trait Array2 where
|
|||
type Row: Array1<Element = Self::Element>;
|
||||
|
||||
/// Get the pointer to the first element of the array.
|
||||
fn ptr<'a>(&'a self) -> &'a Self::Element {
|
||||
#[inline]
|
||||
fn as_ptr(&self) -> *const Self::Element {
|
||||
&self[0][0]
|
||||
}
|
||||
|
||||
/// Get a mutable pointer to the first element of the array.
|
||||
fn mut_ptr<'a>(&'a mut self) -> &'a mut Self::Element {
|
||||
#[inline]
|
||||
fn as_mut_ptr(&mut self) -> *mut Self::Element {
|
||||
&mut self[0][0]
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue