From 2595db16072e4c5176f780203ac347d372fe2277 Mon Sep 17 00:00:00 2001 From: Jack Wrenn Date: Mon, 10 Dec 2018 10:52:19 -0500 Subject: [PATCH] Fix doctests broken by 35d2381a2a9a1f59bb0cd34f69a42441bc7e94e7 --- src/geometry/quaternion.rs | 4 ++-- src/geometry/quaternion_construction.rs | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/geometry/quaternion.rs b/src/geometry/quaternion.rs index 0d5275dc..4b0ce6b3 100644 --- a/src/geometry/quaternion.rs +++ b/src/geometry/quaternion.rs @@ -156,7 +156,7 @@ impl Quaternion { /// let inv_q = q.try_inverse(); /// /// assert!(inv_q.is_some()); - /// assert_relative_eq!(inv_q.into_inner() * q, Quaternion::identity()); + /// assert_relative_eq!(inv_q.unwrap() * q, Quaternion::identity()); /// /// //Non-invertible case /// let q = Quaternion::new(0.0, 0.0, 0.0, 0.0); @@ -914,7 +914,7 @@ impl UnitQuaternion { /// let angle = 1.2; /// let rot = UnitQuaternion::from_axis_angle(&axis, angle); /// let pow = rot.powf(2.0); - /// assert_relative_eq!(pow.axis().into_inner(), axis, epsilon = 1.0e-6); + /// assert_relative_eq!(pow.axis().unwrap(), axis, epsilon = 1.0e-6); /// assert_eq!(pow.angle(), 2.4); /// ``` #[inline] diff --git a/src/geometry/quaternion_construction.rs b/src/geometry/quaternion_construction.rs index f99c5ec6..e48bfaae 100644 --- a/src/geometry/quaternion_construction.rs +++ b/src/geometry/quaternion_construction.rs @@ -176,7 +176,7 @@ impl UnitQuaternion { /// let vec = Vector3::new(4.0, 5.0, 6.0); /// let q = UnitQuaternion::from_axis_angle(&axis, angle); /// - /// assert_eq!(q.axis().into_inner(), axis); + /// assert_eq!(q.axis().unwrap(), axis); /// assert_eq!(q.angle(), angle); /// assert_relative_eq!(q * pt, Point3::new(6.0, 5.0, -4.0), epsilon = 1.0e-6); /// assert_relative_eq!(q * vec, Vector3::new(6.0, 5.0, -4.0), epsilon = 1.0e-6); @@ -244,7 +244,7 @@ impl UnitQuaternion { /// let rot = Rotation3::from_axis_angle(&axis, angle); /// let q = UnitQuaternion::from_rotation_matrix(&rot); /// assert_relative_eq!(q.to_rotation_matrix(), rot, epsilon = 1.0e-6); - /// assert_relative_eq!(q.axis().into_inner(), rot.axis().into_inner(), epsilon = 1.0e-6); + /// assert_relative_eq!(q.axis().unwrap(), rot.axis().unwrap(), epsilon = 1.0e-6); /// assert_relative_eq!(q.angle(), rot.angle(), epsilon = 1.0e-6); /// ``` #[inline] @@ -306,7 +306,7 @@ impl UnitQuaternion { /// # use nalgebra::{Vector3, UnitQuaternion}; /// let a = Vector3::new(1.0, 2.0, 3.0); /// let b = Vector3::new(3.0, 1.0, 2.0); - /// let q = UnitQuaternion::rotation_between(&a, &b).into_inner(); + /// let q = UnitQuaternion::rotation_between(&a, &b).unwrap(); /// assert_relative_eq!(q * a, b); /// assert_relative_eq!(q.inverse() * b, a); /// ``` @@ -329,8 +329,8 @@ impl UnitQuaternion { /// # use nalgebra::{Vector3, UnitQuaternion}; /// let a = Vector3::new(1.0, 2.0, 3.0); /// let b = Vector3::new(3.0, 1.0, 2.0); - /// let q2 = UnitQuaternion::scaled_rotation_between(&a, &b, 0.2).into_inner(); - /// let q5 = UnitQuaternion::scaled_rotation_between(&a, &b, 0.5).into_inner(); + /// let q2 = UnitQuaternion::scaled_rotation_between(&a, &b, 0.2).unwrap(); + /// let q5 = UnitQuaternion::scaled_rotation_between(&a, &b, 0.5).unwrap(); /// assert_relative_eq!(q2 * q2 * q2 * q2 * q2 * a, b, epsilon = 1.0e-6); /// assert_relative_eq!(q5 * q5 * a, b, epsilon = 1.0e-6); /// ``` @@ -365,7 +365,7 @@ impl UnitQuaternion { /// # use nalgebra::{Unit, Vector3, UnitQuaternion}; /// let a = Unit::new_normalize(Vector3::new(1.0, 2.0, 3.0)); /// let b = Unit::new_normalize(Vector3::new(3.0, 1.0, 2.0)); - /// let q = UnitQuaternion::rotation_between(&a, &b).into_inner(); + /// let q = UnitQuaternion::rotation_between(&a, &b).unwrap(); /// assert_relative_eq!(q * a, b); /// assert_relative_eq!(q.inverse() * b, a); /// ``` @@ -391,8 +391,8 @@ impl UnitQuaternion { /// # use nalgebra::{Unit, Vector3, UnitQuaternion}; /// let a = Unit::new_normalize(Vector3::new(1.0, 2.0, 3.0)); /// let b = Unit::new_normalize(Vector3::new(3.0, 1.0, 2.0)); - /// let q2 = UnitQuaternion::scaled_rotation_between(&a, &b, 0.2).into_inner(); - /// let q5 = UnitQuaternion::scaled_rotation_between(&a, &b, 0.5).into_inner(); + /// let q2 = UnitQuaternion::scaled_rotation_between(&a, &b, 0.2).unwrap(); + /// let q5 = UnitQuaternion::scaled_rotation_between(&a, &b, 0.5).unwrap(); /// assert_relative_eq!(q2 * q2 * q2 * q2 * q2 * a, b, epsilon = 1.0e-6); /// assert_relative_eq!(q5 * q5 * a, b, epsilon = 1.0e-6); /// ```