diff --git a/src/cgmath/matrix.rs b/src/cgmath/matrix.rs index 27ae0f7..cf9dc24 100644 --- a/src/cgmath/matrix.rs +++ b/src/cgmath/matrix.rs @@ -566,8 +566,8 @@ impl ToQuat for Mat3 { // http://www.cs.ucr.edu/~vbz/resources/Quatut.pdf let trace = self.trace(); let half: S = cast(0.5); - cond! ( - (trace >= zero::()) { + match () { + () if trace >= zero::() => { let s = sqrt(one::() + trace); let w = half * s; let s = half / s; @@ -576,7 +576,7 @@ impl ToQuat for Mat3 { let z = (*self.cr(0, 1) - *self.cr(1, 0)) * s; Quat::new(w, x, y, z) } - ((*self.cr(0, 0) > *self.cr(1, 1)) && (*self.cr(0, 0) > *self.cr(2, 2))) { + () if (*self.cr(0, 0) > *self.cr(1, 1)) && (*self.cr(0, 0) > *self.cr(2, 2)) => { let s = sqrt(half + (*self.cr(0, 0) - *self.cr(1, 1) - *self.cr(2, 2))); let w = half * s; let s = half / s; @@ -585,7 +585,7 @@ impl ToQuat for Mat3 { let z = (*self.cr(1, 2) - *self.cr(2, 1)) * s; Quat::new(w, x, y, z) } - (*self.cr(1, 1) > *self.cr(2, 2)) { + () if *self.cr(1, 1) > *self.cr(2, 2) => { let s = sqrt(half + (*self.cr(1, 1) - *self.cr(0, 0) - *self.cr(2, 2))); let w = half * s; let s = half / s; @@ -594,7 +594,7 @@ impl ToQuat for Mat3 { let z = (*self.cr(2, 0) - *self.cr(0, 2)) * s; Quat::new(w, x, y, z) } - _ { + () => { let s = sqrt(half + (*self.cr(2, 2) - *self.cr(0, 0) - *self.cr(1, 1))); let w = half * s; let s = half / s; @@ -603,6 +603,6 @@ impl ToQuat for Mat3 { let z = (*self.cr(0, 1) - *self.cr(1, 0)) * s; Quat::new(w, x, y, z) } - ) + } } }