Skip to content

Commit

Permalink
One more tweak for DecBy before I publish 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
slightlyoutofphase committed Apr 1, 2021
1 parent bd745d0 commit 413c5dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl<T: Copy + Default + Step, const STEP: usize> Iterator for DecBy<T, STEP> {
#[inline(always)]
fn next(&mut self) -> Option<T> {
if let Some(remaining) = Step::backward_checked(self.start, STEP) {
if Step::forward(remaining, STEP) >= self.end {
if self.start >= self.end {
let res = Some(self.start);
self.start = remaining;
res
Expand Down

0 comments on commit 413c5dc

Please sign in to comment.