Skip to content

Commit 945f70d

Browse files
committed
Restore remove_index to DataOwned
I think I accidentally moved this over to ArrayRef, but we're not sure it should still require DataOwned
1 parent cbed837 commit 945f70d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/impl_methods.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3102,7 +3102,13 @@ impl<A, D: Dimension> ArrayRef<A, D>
31023102
Zip::from(self.lanes_mut(axis)).map_collect(mapping)
31033103
}
31043104
}
3105+
}
31053106

3107+
impl<A, S, D> ArrayBase<S, D>
3108+
where
3109+
S: DataOwned<Elem = A> + DataMut,
3110+
D: Dimension,
3111+
{
31063112
/// Remove the `index`th elements along `axis` and shift down elements from higher indexes.
31073113
///
31083114
/// Note that this "removes" the elements by swapping them around to the end of the axis and
@@ -3115,7 +3121,6 @@ impl<A, D: Dimension> ArrayRef<A, D>
31153121
/// ***Panics*** if `axis` is out of bounds<br>
31163122
/// ***Panics*** if not `index < self.len_of(axis)`.
31173123
pub fn remove_index(&mut self, axis: Axis, index: usize)
3118-
// TODO: Check whether this needed to be DataOwned
31193124
{
31203125
assert!(index < self.len_of(axis), "index {} must be less than length of Axis({})",
31213126
index, axis.index());
@@ -3125,7 +3130,10 @@ impl<A, D: Dimension> ArrayRef<A, D>
31253130
// then slice the axis in place to cut out the removed final element
31263131
self.slice_axis_inplace(axis, Slice::new(0, Some(-1), 1));
31273132
}
3133+
}
31283134

3135+
impl<A, D: Dimension> ArrayRef<A, D>
3136+
{
31293137
/// Iterates over pairs of consecutive elements along the axis.
31303138
///
31313139
/// The first argument to the closure is an element, and the second

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy