mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-29 03:37:26 +03:00
Wrap
This commit is contained in:
@@ -792,7 +792,7 @@ pub fn with_end(mut self, end: u128) -> Self {
|
||||
pub fn is_full_for(&self, size: Size) -> bool {
|
||||
let max_value = size.unsigned_int_max();
|
||||
debug_assert!(self.start <= max_value && self.end <= max_value);
|
||||
(self.start == 0 && self.end == max_value) || (self.end + 1 == self.start)
|
||||
(self.start == 0 && self.end == max_value) || (self.end.wrapping_add(1) == self.start)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user