Skip to content

Commit 95d21b2

Browse files
committed
Relax constraints on ArrayBase methods
1 parent 8e6a936 commit 95d21b2

File tree

3 files changed

+121
-38
lines changed

3 files changed

+121
-38
lines changed

src/impl_1d.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ use imp_prelude::*;
1212

1313
/// # Methods For 1-D Arrays
1414
impl<A, S> ArrayBase<S, Ix1>
15-
where S: Data<Elem=A>,
15+
where S: DataRaw<Elem=A>,
1616
{
1717
/// Return an vector with the elements of the one-dimensional array.
1818
pub fn to_vec(&self) -> Vec<A>
19-
where A: Clone,
19+
where
20+
A: Clone,
21+
S: Data,
2022
{
2123
if let Some(slc) = self.as_slice() {
2224
slc.to_vec()

src/impl_2d.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ use imp_prelude::*;
1212

1313
/// # Methods For 2-D Arrays
1414
impl<A, S> ArrayBase<S, Ix2>
15-
where S: Data<Elem=A>,
15+
where S: DataRaw<Elem=A>,
1616
{
1717
/// Return an array view of row `index`.
1818
///
1919
/// **Panics** if `index` is out of bounds.
2020
pub fn row(&self, index: Ix) -> ArrayView1<A>
21+
where
22+
S: Data,
2123
{
2224
self.index_axis(Axis(0), index)
2325
}
@@ -40,6 +42,8 @@ impl<A, S> ArrayBase<S, Ix2>
4042
///
4143
/// **Panics** if `index` is out of bounds.
4244
pub fn column(&self, index: Ix) -> ArrayView1<A>
45+
where
46+
S: Data,
4347
{
4448
self.index_axis(Axis(1), index)
4549
}

0 commit comments

Comments
 (0)