Skip to content

Commit 435a9e7

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 1bb06e7 commit 435a9e7

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
@@ -3099,7 +3099,13 @@ impl<A, D: Dimension> ArrayRef<A, D>
30993099
Zip::from(self.lanes_mut(axis)).map_collect(mapping)
31003100
}
31013101
}
3102+
}
31023103

3104+
impl<A, S, D> ArrayBase<S, D>
3105+
where
3106+
S: DataOwned<Elem = A> + DataMut,
3107+
D: Dimension,
3108+
{
31033109
/// Remove the `index`th elements along `axis` and shift down elements from higher indexes.
31043110
///
31053111
/// Note that this "removes" the elements by swapping them around to the end of the axis and
@@ -3112,7 +3118,6 @@ impl<A, D: Dimension> ArrayRef<A, D>
31123118
/// ***Panics*** if `axis` is out of bounds<br>
31133119
/// ***Panics*** if not `index < self.len_of(axis)`.
31143120
pub fn remove_index(&mut self, axis: Axis, index: usize)
3115-
// TODO: Check whether this needed to be DataOwned
31163121
{
31173122
assert!(index < self.len_of(axis), "index {} must be less than length of Axis({})",
31183123
index, axis.index());
@@ -3122,7 +3127,10 @@ impl<A, D: Dimension> ArrayRef<A, D>
31223127
// then slice the axis in place to cut out the removed final element
31233128
self.slice_axis_inplace(axis, Slice::new(0, Some(-1), 1));
31243129
}
3130+
}
31253131

3132+
impl<A, D: Dimension> ArrayRef<A, D>
3133+
{
31263134
/// Iterates over pairs of consecutive elements along the axis.
31273135
///
31283136
/// The first argument to the closure is an element, and the second

0 commit comments

Comments
 (0)