From 9d5b4c5fd4757032deeb67366b3847ab6698acba Mon Sep 17 00:00:00 2001 From: timofey Date: Sun, 18 Jun 2023 13:20:34 +0000 Subject: [PATCH] simplify `BalancingError` --- src/flow/binary/balancing.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/flow/binary/balancing.rs b/src/flow/binary/balancing.rs index 23aab1f..953f59a 100644 --- a/src/flow/binary/balancing.rs +++ b/src/flow/binary/balancing.rs @@ -48,14 +48,11 @@ pub enum BalancingError { impl Display for BalancingError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - Self::Height(height_error) => write!(f, "invalid AVL non-leaf height: {height_error}"), - Self::Balance(hl, hr) => write!(f, "unbalanced AVL node: {hl} {hr}."), - Self::HeightOverflow => write!(f, "AVL tree height overflow"), + Self::Height(height_error) => write!(f, "height error: {height_error}"), + Self::Balance(hl, hr) => write!(f, "unbalanced node: {hl} {hr}."), + Self::HeightOverflow => write!(f, "tree height overflow"), Self::HeightMismatch { children, parent } => { - write!( - f, - "AVL child-parent height mismatch: {children:?}, {parent}" - ) + write!(f, "child-parent height mismatch: {children:?}, {parent}") } } }