BoundNode2 -> BoundNode

This commit is contained in:
AF 2023-07-30 14:55:21 +00:00
parent 57bb3a5d4a
commit c368a51fe1

View File

@ -17,7 +17,7 @@ impl<A, T> std::ops::Deref for Bound<A, T> {
} }
} }
pub struct BoundNode2<A, T> { pub struct BoundNode<A, T> {
boundsl: Bounds<A>, boundsl: Bounds<A>,
boundsr: Bounds<A>, boundsr: Bounds<A>,
bounds: Bounds<A>, bounds: Bounds<A>,
@ -53,7 +53,7 @@ pub trait BinaryTreesBindable<'a>: BinaryTrees<'a> {
} }
impl<'a, BT: BinaryTreesBindable<'a>> BinaryTrees<'a> for BoundTrees<BT> { impl<'a, BT: BinaryTreesBindable<'a>> BinaryTrees<'a> for BoundTrees<BT> {
type Node = BoundNode2<Self::Key, BT::Node>; type Node = BoundNode<Self::Key, BT::Node>;
type Reference = Bound<Self::Key, BT::Reference>; type Reference = Bound<Self::Key, BT::Reference>;
@ -92,7 +92,7 @@ impl<'a, BT: BinaryTreesBindable<'a>> BinaryTrees<'a> for BoundTrees<BT> {
ctx.bounds_bind( ctx.bounds_bind(
bounds.clone().split(&key, ctx.comparator()), bounds.clone().split(&key, ctx.comparator()),
|(boundsl, boundsr)| { |(boundsl, boundsr)| {
Self::pure(BoundNode2 { Self::pure(BoundNode {
boundsl, boundsl,
boundsr, boundsr,
bounds, bounds,
@ -187,13 +187,11 @@ impl<'a, BT: BinaryTreesBindable<'a> + BinaryTreesTryJoin<'a>> BinaryTreesTryJoi
self.0.bounds_bind( self.0.bounds_bind(
Bounds::join(boundsl.clone(), boundsr.clone(), &key, self.comparator()), Bounds::join(boundsl.clone(), boundsr.clone(), &key, self.comparator()),
|bounds| { |bounds| {
Self::fmap(self.0.try_join(tl.bound, key, tr.bound), |node| { Self::fmap(self.0.try_join(tl.bound, key, tr.bound), |node| BoundNode {
BoundNode2 { boundsl,
boundsl, boundsr,
boundsr, bounds,
bounds, node,
node,
}
}) })
}, },
) )