From c062ad26eafa340c4d450165d99f08e2173d05c3 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Fri, 31 Oct 2014 23:31:09 -0400 Subject: [PATCH] Simplify some logic --- src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index ed5d942..cce6481 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -207,13 +207,13 @@ impl Node { match insert_result { Fit(returned_node) => { - let new_node = match next_direction { - Left => ThreeNode(Three(value1, value2, box returned_node, other_node1, other_node2)), - Middle => ThreeNode(Three(value1, value2, other_node1, box returned_node, other_node2)), - Right => ThreeNode(Three(value1, value2, other_node1, other_node2, box returned_node)), + let three = match next_direction { + Left => Three(value1, value2, box returned_node, other_node1, other_node2), + Middle => Three(value1, value2, other_node1, box returned_node, other_node2), + Right => Three(value1, value2, other_node1, other_node2, box returned_node), _ => fail!(""), }; - Fit(new_node) + Fit(three.to_node()) }, Split(four_node) => { let new_node: Four = match next_direction { -- 2.51.2