From 5f6733fdb0c96df787a655b184240b7aaf8446d1 Mon Sep 17 00:00:00 2001 From: Matthew Gordon Date: Fri, 10 Jan 2020 16:21:38 -0500 Subject: [PATCH] Move some declarations around within struct, no change in functionality --- src/raycasting/axis_aligned_bounding_box.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/raycasting/axis_aligned_bounding_box.rs b/src/raycasting/axis_aligned_bounding_box.rs index 496cc2b..72975a2 100644 --- a/src/raycasting/axis_aligned_bounding_box.rs +++ b/src/raycasting/axis_aligned_bounding_box.rs @@ -26,13 +26,6 @@ impl Interval { } } - pub fn intersection(self, b: Self) -> Self { - Interval { - min: self.min.max(b.min), - max: self.max.min(b.max), - } - } - pub fn is_degenerate(self) -> bool { self.min == self.max } @@ -44,6 +37,13 @@ impl Interval { pub fn contains_value(&self, value: T) -> bool { value >= self.min && value <= self.max } + + pub fn intersection(self, b: Self) -> Self { + Interval { + min: self.min.max(b.min), + max: self.max.min(b.max), + } + } } pub struct BoundingBox {