diff --git a/src/sphere.rs b/src/sphere.rs index b1c5977..17beb81 100644 --- a/src/sphere.rs +++ b/src/sphere.rs @@ -27,9 +27,9 @@ impl Hittable for Sphere { let sqrtd = discriminant.sqrt(); // nearest root that lies within tolerance - let root = (-half_b - sqrtd) / a; + let mut root = (-half_b - sqrtd) / a; if root < t_min || root > t_max { - let root = (-half_b + sqrtd) / a; + root = (-half_b + sqrtd) / a; if root < t_min || root > t_max { return None; }