mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-21 22:34:05 +00:00
fix the impl error in insert_all
This commit is contained in:
parent
7e1901537c
commit
65a5b082bc
@ -203,7 +203,9 @@ impl<I: Idx> IntervalSet<I> {
|
||||
|
||||
pub fn insert_all(&mut self) {
|
||||
self.clear();
|
||||
self.map.push((0, self.domain.try_into().unwrap()));
|
||||
if let Some(end) = self.domain.checked_sub(1) {
|
||||
self.map.push((0, end.try_into().unwrap()));
|
||||
}
|
||||
debug_assert!(self.check_invariants());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user