From 426ba307abc176a07691dbd8c87541349ef0eb77 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Thu, 30 Oct 2014 00:25:47 -0400 Subject: [PATCH] fail -> panic --- src/structs/rot.rs | 16 ++++++++-------- src/structs/spec/identity.rs | 30 +++++++++++++++--------------- src/structs/spec/mat.rs | 8 ++++---- src/structs/spec/vec.rs | 6 +++--- src/structs/spec/vec0.rs | 4 ++-- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/structs/rot.rs b/src/structs/rot.rs index 333d484b..681ec6e2 100644 --- a/src/structs/rot.rs +++ b/src/structs/rot.rs @@ -227,7 +227,7 @@ Rotation> for Rot3 { if denom.is_zero() { // XXX: handle that properly - // fail!("Internal error: singularity.") + // panic!("Internal error: singularity.") Zero::zero() } else { @@ -338,37 +338,37 @@ impl Rotation> for Rot4 { #[inline] fn rotation(&self) -> Vec4 { - fail!("Not yet implemented") + panic!("Not yet implemented") } #[inline] fn inv_rotation(&self) -> Vec4 { - fail!("Not yet implemented") + panic!("Not yet implemented") } #[inline] fn append_rotation(&mut self, _: &Vec4) { - fail!("Not yet implemented") + panic!("Not yet implemented") } #[inline] fn append_rotation_cpy(_: &Rot4, _: &Vec4) -> Rot4 { - fail!("Not yet implemented") + panic!("Not yet implemented") } #[inline] fn prepend_rotation(&mut self, _: &Vec4) { - fail!("Not yet implemented") + panic!("Not yet implemented") } #[inline] fn prepend_rotation_cpy(_: &Rot4, _: &Vec4) -> Rot4 { - fail!("Not yet implemented") + panic!("Not yet implemented") } #[inline] fn set_rotation(&mut self, _: Vec4) { - fail!("Not yet implemented") + panic!("Not yet implemented") } } diff --git a/src/structs/spec/identity.rs b/src/structs/spec/identity.rs index 1fc39f50..b33d2f25 100644 --- a/src/structs/spec/identity.rs +++ b/src/structs/spec/identity.rs @@ -51,27 +51,27 @@ impl Translation for mat::Identity { #[inline] fn append_translation(&mut self, _: &V) { - fail!("Attempted to translate the identity matrix.") + panic!("Attempted to translate the identity matrix.") } #[inline] fn append_translation_cpy(_: &mat::Identity, _: &V) -> mat::Identity { - fail!("Attempted to translate the identity matrix.") + panic!("Attempted to translate the identity matrix.") } #[inline] fn prepend_translation(&mut self, _: &V) { - fail!("Attempted to translate the identity matrix.") + panic!("Attempted to translate the identity matrix.") } #[inline] fn prepend_translation_cpy(_: &mat::Identity, _: &V) -> mat::Identity { - fail!("Attempted to translate the identity matrix.") + panic!("Attempted to translate the identity matrix.") } #[inline] fn set_translation(&mut self, _: V) { - fail!("Attempted to translate the identity matrix.") + panic!("Attempted to translate the identity matrix.") } } @@ -100,27 +100,27 @@ impl Rotation for mat::Identity { #[inline] fn append_rotation(&mut self, _: &V) { - fail!("Attempted to rotate the identity matrix.") + panic!("Attempted to rotate the identity matrix.") } #[inline] fn append_rotation_cpy(_: &mat::Identity, _: &V) -> mat::Identity { - fail!("Attempted to rotate the identity matrix.") + panic!("Attempted to rotate the identity matrix.") } #[inline] fn prepend_rotation(&mut self, _: &V) { - fail!("Attempted to rotate the identity matrix.") + panic!("Attempted to rotate the identity matrix.") } #[inline] fn prepend_rotation_cpy(_: &mat::Identity, _: &V) -> mat::Identity { - fail!("Attempted to rotate the identity matrix.") + panic!("Attempted to rotate the identity matrix.") } #[inline] fn set_rotation(&mut self, _: V) { - fail!("Attempted to rotate the identity matrix.") + panic!("Attempted to rotate the identity matrix.") } } @@ -156,27 +156,27 @@ impl Transformation for mat::Identity { #[inline] fn append_transformation(&mut self, _: &M) { - fail!("Attempted to transform the identity matrix.") + panic!("Attempted to transform the identity matrix.") } #[inline] fn append_transformation_cpy(_: &mat::Identity, _: &M) -> mat::Identity { - fail!("Attempted to transform the identity matrix.") + panic!("Attempted to transform the identity matrix.") } #[inline] fn prepend_transformation(&mut self, _: &M) { - fail!("Attempted to transform the identity matrix.") + panic!("Attempted to transform the identity matrix.") } #[inline] fn prepend_transformation_cpy(_: &mat::Identity, _: &M) -> mat::Identity { - fail!("Attempted to transform the identity matrix.") + panic!("Attempted to transform the identity matrix.") } #[inline] fn set_transformation(&mut self, _: M) { - fail!("Attempted to transform the identity matrix.") + panic!("Attempted to transform the identity matrix.") } } diff --git a/src/structs/spec/mat.rs b/src/structs/spec/mat.rs index 58789510..19d5c573 100644 --- a/src/structs/spec/mat.rs +++ b/src/structs/spec/mat.rs @@ -144,7 +144,7 @@ impl Row> for Mat3 { 0 => Vec3::new(self.m11.clone(), self.m12.clone(), self.m13.clone()), 1 => Vec3::new(self.m21.clone(), self.m22.clone(), self.m23.clone()), 2 => Vec3::new(self.m31.clone(), self.m32.clone(), self.m33.clone()), - _ => fail!(format!("Index out of range: 3d matrices do not have {} rows.", i)) + _ => panic!(format!("Index out of range: 3d matrices do not have {} rows.", i)) } } @@ -166,7 +166,7 @@ impl Row> for Mat3 { self.m32 = r.y.clone(); self.m33 = r.z; }, - _ => fail!(format!("Index out of range: 3d matrices do not have {} rows.", i)) + _ => panic!(format!("Index out of range: 3d matrices do not have {} rows.", i)) } } @@ -184,7 +184,7 @@ impl Col> for Mat3 { 0 => Vec3::new(self.m11.clone(), self.m21.clone(), self.m31.clone()), 1 => Vec3::new(self.m12.clone(), self.m22.clone(), self.m32.clone()), 2 => Vec3::new(self.m13.clone(), self.m23.clone(), self.m33.clone()), - _ => fail!(format!("Index out of range: 3d matrices do not have {} cols.", i)) + _ => panic!(format!("Index out of range: 3d matrices do not have {} cols.", i)) } } @@ -206,7 +206,7 @@ impl Col> for Mat3 { self.m23 = r.y.clone(); self.m33 = r.z; }, - _ => fail!(format!("Index out of range: 3d matrices do not have {} cols.", i)) + _ => panic!(format!("Index out of range: 3d matrices do not have {} cols.", i)) } } diff --git a/src/structs/spec/vec.rs b/src/structs/spec/vec.rs index a4e94c65..9e084eca 100644 --- a/src/structs/spec/vec.rs +++ b/src/structs/spec/vec.rs @@ -53,7 +53,7 @@ impl Row> for Vec2 { match i { 0 => Vec1::new(self.x.clone()), 1 => Vec1::new(self.y.clone()), - _ => fail!(format!("Index out of range: 2d vectors do not have {} rows. ", i)) + _ => panic!(format!("Index out of range: 2d vectors do not have {} rows. ", i)) } } @@ -62,7 +62,7 @@ impl Row> for Vec2 { match i { 0 => self.x = r.x, 1 => self.y = r.x, - _ => fail!(format!("Index out of range: 2d vectors do not have {} rows.", i)) + _ => panic!(format!("Index out of range: 2d vectors do not have {} rows.", i)) } } @@ -213,7 +213,7 @@ impl + Clone> UniformSphereSample for Vec3 { impl + Clone> UniformSphereSample for Vec4 { #[inline(always)] fn sample(_: |Vec4| -> ()) { - fail!("UniformSphereSample::>::sample : Not yet implemented.") + panic!("UniformSphereSample::>::sample : Not yet implemented.") // for sample in SAMPLES_3_F32.iter() { // f(Cast::from(*sample)) // } diff --git a/src/structs/spec/vec0.rs b/src/structs/spec/vec0.rs index a7fea6ed..84ae6d47 100644 --- a/src/structs/spec/vec0.rs +++ b/src/structs/spec/vec0.rs @@ -10,7 +10,7 @@ use structs::vec; impl Indexable for vec::Vec0 { #[inline] fn at(&self, _: uint) -> N { - fail!("Cannot index a Vec0.") + panic!("Cannot index a Vec0.") } #[inline] @@ -28,7 +28,7 @@ impl Indexable for vec::Vec0 { #[inline] unsafe fn unsafe_at(&self, _: uint) -> N { - fail!("Cannot index a Vec0.") + panic!("Cannot index a Vec0.") } #[inline]