From 4d635e9e6a1b54ae1a2616debc5b053b1b98b144 Mon Sep 17 00:00:00 2001 From: timofey Date: Fri, 16 Jun 2023 09:27:51 +0000 Subject: [PATCH] more concrete `BoundsError` --- src/flow/binary/bounds.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/flow/binary/bounds.rs b/src/flow/binary/bounds.rs index 0e96553..8069798 100644 --- a/src/flow/binary/bounds.rs +++ b/src/flow/binary/bounds.rs @@ -10,7 +10,8 @@ pub struct Bounds { pub enum BoundsError { BoundsViolated { l: A, r: A }, - CannotJoin(A), + OverflowL(A), + OverflowR(A), } impl Bounds { @@ -60,12 +61,12 @@ impl Bounds { if let Some(lr) = &l.r { Self::ordered(lr, key, comparator)? } else { - Err(BoundsError::CannotJoin(key.clone()))? + Err(BoundsError::OverflowL(key.clone()))? } if let Some(rl) = &r.l { Self::ordered(key, rl, comparator)? } else { - Err(BoundsError::CannotJoin(key.clone()))? + Err(BoundsError::OverflowR(key.clone()))? } Self::new(l.l, r.r, comparator) }