From 61d065fb03040ee06f518ed7e75f14b42abfac82 Mon Sep 17 00:00:00 2001 From: ripytide Date: Mon, 5 Dec 2022 20:21:02 +0000 Subject: [PATCH] passing all tests --- src/range_bounds_map.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/range_bounds_map.rs b/src/range_bounds_map.rs index 23e7f3d..36677d5 100644 --- a/src/range_bounds_map.rs +++ b/src/range_bounds_map.rs @@ -1100,7 +1100,8 @@ where /// `RangeBounds`. /// /// This is equivalent to using [`RangeBoundsMap::cut()`] - /// followed by [`RangeBoundsMap::insert_platonic()`]. + /// followed by [`RangeBoundsMap::insert_platonic()`]. Hence the + /// same `V: Clone` trait bound applies. /// /// If the remaining `RangeBounds` left after the cut are not able /// to be created with the [`TryFromBounds`] trait then a @@ -1124,8 +1125,15 @@ where &mut self, range_bounds: K, value: V, - ) -> Result<(), TryFromBoundsError> { - todo!() + ) -> Result<(), TryFromBoundsError> + where + V: Clone, + K: TryFromBounds, + { + self.cut(&range_bounds)?; + self.insert_platonic(range_bounds, value).unwrap(); + + return Ok(()); } }