Skip to content

Commit 2d23a76

Browse files
committed
Remove undocumented zero_index method from Dimension
1 parent 408e8cd commit 2d23a76

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

src/dimension/dimension_trait.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,6 @@ pub trait Dimension : Clone + Eq + Debug + Send + Sync + Default +
158158
/// **Panics** if `Self` has a fixed size that is not `ndim`.
159159
fn zeros(ndim: usize) -> Self;
160160

161-
#[doc(hidden)]
162-
// Return an index of same dimensionality
163-
fn zero_index(&self) -> Self {
164-
Self::default()
165-
}
166-
167161
#[doc(hidden)]
168162
#[inline]
169163
fn first_index(&self) -> Option<Self> {
@@ -815,11 +809,6 @@ impl Dimension for IxDyn
815809
self
816810
}
817811

818-
#[inline]
819-
fn zero_index(&self) -> Self {
820-
IxDyn::zeros(self.ndim())
821-
}
822-
823812
#[inline]
824813
fn zeros(ndim: usize) -> Self {
825814
IxDyn::zeros(ndim)

src/indexes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub fn indices<E>(shape: E) -> Indices<E::Dim>
3131
{
3232
let dim = shape.into_dimension();
3333
Indices {
34-
start: dim.zero_index(),
34+
start: E::Dim::zeros(dim.ndim()),
3535
dim: dim,
3636
}
3737
}
@@ -210,7 +210,7 @@ pub fn indices_iter_f<E>(shape: E) -> IndicesIterF<E::Dim>
210210
where E: IntoDimension,
211211
{
212212
let dim = shape.into_dimension();
213-
let zero = dim.zero_index();
213+
let zero = E::Dim::zeros(dim.ndim());
214214
IndicesIterF {
215215
has_remaining: dim.size_checked() != Some(0),
216216
index: zero,

0 commit comments

Comments
 (0)