TreeContext::node_heights

This commit is contained in:
AF 2023-06-19 07:20:52 +00:00
parent 5973fe94eb
commit 2af7c5cab0

View File

@ -179,6 +179,10 @@ impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx> + Clone, C: 'a + Comparator<A
fn balancing_error<T: 'a>(&self, error: BalancingError) -> BTWrap<'a, Self, T> { fn balancing_error<T: 'a>(&self, error: BalancingError) -> BTWrap<'a, Self, T> {
Self::fail(error.into()) Self::fail(error.into())
} }
fn node_heights(&self, node: &Self::Node) -> (u64, u64) {
(node.l.height, node.r.height)
}
} }
impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx> + Clone, C: 'a + Comparator<A>, E: 'a> impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx> + Clone, C: 'a + Comparator<A>, E: 'a>