Skip to content

Commit

Permalink
from review: code style
Browse files Browse the repository at this point in the history
Co-authored-by: Ivan Tham <pickfire@riseup.net>
  • Loading branch information
the8472 and pickfire committed Sep 30, 2021
1 parent 2c6e671 commit 6654a0b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/core/src/iter/adapters/take.rs
Expand Up @@ -115,8 +115,8 @@ where
#[inline]
#[rustc_inherit_overflow_checks]
fn advance_by(&mut self, n: usize) -> Result<(), usize> {
let min = crate::cmp::min(self.n, n);
return match self.iter.advance_by(min) {
let min = self.n.min(n);
match self.iter.advance_by(min) {
Ok(_) => {
self.n -= min;
if min < n { Err(min) } else { Ok(()) }
Expand All @@ -125,7 +125,7 @@ where
self.n -= advanced;
ret
}
};
}
}
}

Expand Down

0 comments on commit 6654a0b

Please sign in to comment.