Skip to content

Commit 27c4a92

Browse files
We already know that ndim > 0
1 parent 29a8f70 commit 27c4a92

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/arrayformat.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ fn format_array<A, S, D, F>(view: &ArrayBase<S, D>,
5858
// as cues for when to add []'s and how many to add.
5959
for (index, elt) in view.indexed_iter() {
6060
let index = index.into_dimension();
61-
let take_n = if ndim == 0 { 1 } else { ndim - 1 };
6261
let mut update_index = false;
6362

6463
let skip_row_for_axis = overflow_axes.iter()
@@ -78,7 +77,7 @@ fn format_array<A, S, D, F>(view: &ArrayBase<S, D>,
7877

7978
for (i, (a, b)) in index.slice()
8079
.iter()
81-
.take(take_n)
80+
.take(ndim-1)
8281
.zip(last_index.slice().iter())
8382
.enumerate() {
8483
if a != b {

0 commit comments

Comments
 (0)