aboutsummaryrefslogtreecommitdiff
path: root/src/hittable/aabb.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/hittable/aabb.rs')
-rw-r--r--src/hittable/aabb.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/hittable/aabb.rs b/src/hittable/aabb.rs
index 5c5c9fa..92b8fa1 100644
--- a/src/hittable/aabb.rs
+++ b/src/hittable/aabb.rs
@@ -16,9 +16,7 @@ impl AABB {
let mut t0 = (self.minimum.get(a).unwrap() - ray.origin.get(a).unwrap()) * inv_d;
let mut t1 = (self.maximum.get(a).unwrap() - ray.origin.get(a).unwrap()) * inv_d;
if inv_d < 0.0 {
- // TODO: destructuring assignments are unstable :(
- //(t0, t1) = (t1, t0);
- std::mem::swap(&mut t0, &mut t1);
+ (t0, t1) = (t1, t0);
}
t_min = if t0 > t_min { t0 } else { t_min };
t_max = if t1 < t_max { t1 } else { t_max };