Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fail -> panic #29

Merged
merged 1 commit into from
Oct 30, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/structs/rot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ Rotation<Vec3<N>> for Rot3<N> {

if denom.is_zero() {
// XXX: handle that properly
// fail!("Internal error: singularity.")
// panic!("Internal error: singularity.")
Zero::zero()
}
else {
Expand Down Expand Up @@ -338,37 +338,37 @@ impl<N: Float + Clone>
Rotation<Vec4<N>> for Rot4<N> {
#[inline]
fn rotation(&self) -> Vec4<N> {
fail!("Not yet implemented")
panic!("Not yet implemented")
}

#[inline]
fn inv_rotation(&self) -> Vec4<N> {
fail!("Not yet implemented")
panic!("Not yet implemented")
}

#[inline]
fn append_rotation(&mut self, _: &Vec4<N>) {
fail!("Not yet implemented")
panic!("Not yet implemented")
}

#[inline]
fn append_rotation_cpy(_: &Rot4<N>, _: &Vec4<N>) -> Rot4<N> {
fail!("Not yet implemented")
panic!("Not yet implemented")
}

#[inline]
fn prepend_rotation(&mut self, _: &Vec4<N>) {
fail!("Not yet implemented")
panic!("Not yet implemented")
}

#[inline]
fn prepend_rotation_cpy(_: &Rot4<N>, _: &Vec4<N>) -> Rot4<N> {
fail!("Not yet implemented")
panic!("Not yet implemented")
}

#[inline]
fn set_rotation(&mut self, _: Vec4<N>) {
fail!("Not yet implemented")
panic!("Not yet implemented")
}
}

Expand Down
30 changes: 15 additions & 15 deletions src/structs/spec/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,27 @@ impl<V: Zero> Translation<V> 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.")
}
}

Expand Down Expand Up @@ -100,27 +100,27 @@ impl<V: Zero> Rotation<V> 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.")
}
}

Expand Down Expand Up @@ -156,27 +156,27 @@ impl<M: One> Transformation<M> 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.")
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/structs/spec/mat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ impl<N: Clone> Row<Vec3<N>> for Mat3<N> {
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))
}
}

Expand All @@ -166,7 +166,7 @@ impl<N: Clone> Row<Vec3<N>> for Mat3<N> {
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))

}
}
Expand All @@ -184,7 +184,7 @@ impl<N: Clone> Col<Vec3<N>> for Mat3<N> {
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))
}
}

Expand All @@ -206,7 +206,7 @@ impl<N: Clone> Col<Vec3<N>> for Mat3<N> {
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))

}
}
Expand Down
6 changes: 3 additions & 3 deletions src/structs/spec/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl<N: Clone> Row<Vec1<N>> for Vec2<N> {
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))
}
}

Expand All @@ -62,7 +62,7 @@ impl<N: Clone> Row<Vec1<N>> for Vec2<N> {
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))

}
}
Expand Down Expand Up @@ -213,7 +213,7 @@ impl<N: Cast<f32> + Clone> UniformSphereSample for Vec3<N> {
impl<N: Cast<f32> + Clone> UniformSphereSample for Vec4<N> {
#[inline(always)]
fn sample(_: |Vec4<N>| -> ()) {
fail!("UniformSphereSample::<Vec4<N>>::sample : Not yet implemented.")
panic!("UniformSphereSample::<Vec4<N>>::sample : Not yet implemented.")
// for sample in SAMPLES_3_F32.iter() {
// f(Cast::from(*sample))
// }
Expand Down
4 changes: 2 additions & 2 deletions src/structs/spec/vec0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use structs::vec;
impl<N> Indexable<uint, N> for vec::Vec0<N> {
#[inline]
fn at(&self, _: uint) -> N {
fail!("Cannot index a Vec0.")
panic!("Cannot index a Vec0.")
}

#[inline]
Expand All @@ -28,7 +28,7 @@ impl<N> Indexable<uint, N> for vec::Vec0<N> {

#[inline]
unsafe fn unsafe_at(&self, _: uint) -> N {
fail!("Cannot index a Vec0.")
panic!("Cannot index a Vec0.")
}

#[inline]
Expand Down