from review: code style

Co-authored-by: Ivan Tham <pickfire@riseup.net>
This commit is contained in:
the8472 2021-07-13 22:22:24 +02:00 committed by The8472
parent 2c6e67105e
commit 6654a0bbdc

View File

@ -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(()) }
@ -125,7 +125,7 @@ where
self.n -= advanced;
ret
}
};
}
}
}