Skip to content

Commit d8d3dc5

Browse files
committed
Option in next_back had to be unwrapped at the start
1 parent e5a4211 commit d8d3dc5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/iterators/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,10 @@ impl<A> DoubleEndedIterator for Baseiter<A, Ix1>
139139
#[inline]
140140
fn next_back(&mut self) -> Option<Self::Item>
141141
{
142+
let index = self.index?;
142143
self.dim[0] -= 1;
143144
let offset = Ix1::stride_offset(&self.dim, &self.strides);
144-
if self.index? == self.dim {
145+
if index == self.dim {
145146
self.index = None;
146147
}
147148

0 commit comments

Comments
 (0)