fix Bounds::join
This commit is contained in:
parent
692802f5de
commit
48e12f9c95
@ -1 +1 @@
|
|||||||
Subproject commit 8e9ea6c8e0db00818f4384127fabf6022be30daf
|
Subproject commit d430fd9dca7e7ba7475f8be469c2eecb241c0def
|
@ -19,6 +19,7 @@ impl<A> Clone for Bounds<A> {
|
|||||||
|
|
||||||
pub enum BoundsError<A> {
|
pub enum BoundsError<A> {
|
||||||
BoundsViolated { l: Rc<A>, r: Rc<A> },
|
BoundsViolated { l: Rc<A>, r: Rc<A> },
|
||||||
|
CannotJoin(Rc<A>),
|
||||||
}
|
}
|
||||||
|
|
||||||
pub enum BoundError<A, E> {
|
pub enum BoundError<A, E> {
|
||||||
@ -113,13 +114,13 @@ impl<A> Bounds<A> {
|
|||||||
) -> Result<Self, BoundsError<A>> {
|
) -> Result<Self, BoundsError<A>> {
|
||||||
if let Some(lr) = &l.r {
|
if let Some(lr) = &l.r {
|
||||||
Self::ordered(lr, key, comparator)?
|
Self::ordered(lr, key, comparator)?
|
||||||
} else if let Some(ll) = &l.l {
|
} else {
|
||||||
Self::ordered(ll, key, comparator)?
|
Err(BoundsError::CannotJoin(key.clone()))?
|
||||||
}
|
}
|
||||||
if let Some(rl) = &r.l {
|
if let Some(rl) = &r.l {
|
||||||
Self::ordered(key, rl, comparator)?
|
Self::ordered(key, rl, comparator)?
|
||||||
} else if let Some(rr) = &r.r {
|
} else {
|
||||||
Self::ordered(key, rr, comparator)?
|
Err(BoundsError::CannotJoin(key.clone()))?
|
||||||
}
|
}
|
||||||
Self::new(l.l, r.r, comparator)
|
Self::new(l.l, r.r, comparator)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user