From 2af7c5cab0197fc3b2428fcd602504e522b74fd0 Mon Sep 17 00:00:00 2001 From: timofey Date: Mon, 19 Jun 2023 07:20:52 +0000 Subject: [PATCH] `TreeContext::node_heights` --- src/rstd/collections/tree/context.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rstd/collections/tree/context.rs b/src/rstd/collections/tree/context.rs index 71f547f..6cd509b 100644 --- a/src/rstd/collections/tree/context.rs +++ b/src/rstd/collections/tree/context.rs @@ -179,6 +179,10 @@ impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx> + Clone, C: 'a + Comparator(&self, error: BalancingError) -> BTWrap<'a, Self, T> { 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, E: 'a>