Skip to content

Commit eb50663

Browse files
adamreicholdjturner314
authored andcommitted
Rename get_ptr_mut to get_mut_ptr to be more consistent with the as_mut_ptr method.
1 parent 2f0b37b commit eb50663

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/impl_methods.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ where
768768
S: DataMut,
769769
I: NdIndex<D>,
770770
{
771-
unsafe { self.get_ptr_mut(index).map(|ptr| &mut *ptr) }
771+
unsafe { self.get_mut_ptr(index).map(|ptr| &mut *ptr) }
772772
}
773773

774774
/// Return a raw pointer to the element at `index`, or return `None`
@@ -780,15 +780,15 @@ where
780780
/// let mut a = arr2(&[[1., 2.], [3., 4.]]);
781781
///
782782
/// let v = a.raw_view_mut();
783-
/// let p = a.get_ptr_mut((0, 1)).unwrap();
783+
/// let p = a.get_mut_ptr((0, 1)).unwrap();
784784
///
785785
/// unsafe {
786786
/// *p = 5.;
787787
/// }
788788
///
789789
/// assert_eq!(a.get((0, 1)), Some(&5.));
790790
/// ```
791-
pub fn get_ptr_mut<I>(&mut self, index: I) -> Option<*mut A>
791+
pub fn get_mut_ptr<I>(&mut self, index: I) -> Option<*mut A>
792792
where
793793
S: RawDataMut,
794794
I: NdIndex<D>,

src/impl_views/indexing.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ where
164164
fn index(mut self, index: I) -> &'a mut A {
165165
debug_bounds_check!(self, index);
166166
unsafe {
167-
match self.get_ptr_mut(index) {
167+
match self.get_mut_ptr(index) {
168168
Some(ptr) => &mut *ptr,
169169
None => array_out_of_bounds(),
170170
}
@@ -182,7 +182,7 @@ where
182182
fn get(mut self, index: I) -> Option<&'a mut A> {
183183
debug_bounds_check!(self, index);
184184
unsafe {
185-
match self.get_ptr_mut(index) {
185+
match self.get_mut_ptr(index) {
186186
Some(ptr) => Some(&mut *ptr),
187187
None => None,
188188
}

0 commit comments

Comments
 (0)