diff --git a/clovers/src/hitable.rs b/clovers/src/hitable.rs index 4d7c182b..e876d578 100644 --- a/clovers/src/hitable.rs +++ b/clovers/src/hitable.rs @@ -143,7 +143,7 @@ impl<'scene> HitableList<'scene> { /// This method may panic if no finite bounding box can be created for the given `hitables`. #[must_use] pub fn new(hitables: Vec>) -> Self { - let aabb = vec_bounding_box(&hitables).unwrap(); + let aabb = vec_bounding_box(&hitables).expect("No bounding box for hitables"); Self { hitables, aabb } } diff --git a/clovers/src/objects/gltf.rs b/clovers/src/objects/gltf.rs index 28a53817..59a099e0 100644 --- a/clovers/src/objects/gltf.rs +++ b/clovers/src/objects/gltf.rs @@ -72,7 +72,7 @@ impl<'scene> GLTF<'scene> { /// This method may panic if no finite bounding box can be created for the given `hitables`. pub fn new(gltf_init: GLTFInit) -> Self { let hitables: Vec = gltf_init.into(); - let aabb = vec_bounding_box(&hitables).unwrap(); + let aabb = vec_bounding_box(&hitables).expect("No bounding box for hitables"); GLTF { hitables, aabb } } diff --git a/clovers/src/objects/ply.rs b/clovers/src/objects/ply.rs index 76d46f9a..fd28a0b3 100644 --- a/clovers/src/objects/ply.rs +++ b/clovers/src/objects/ply.rs @@ -108,7 +108,7 @@ pub fn initialize_ply<'scene>( hitables.push(Hitable::Triangle(triangle)); } // TODO: remove unwrap - let aabb = vec_bounding_box(&hitables).unwrap(); + let aabb = vec_bounding_box(&hitables).expect("No bounding box for hitables"); PLY { hitables,