Use `assert_relative_eq!` instead of relative_eq!`.

When testing for something, need to use the assert form.
This commit is contained in:
Bruce Mitchener 2023-08-12 22:48:16 +07:00
parent 32a07aca3c
commit 8ba1459602
3 changed files with 5 additions and 5 deletions

View File

@ -97,7 +97,7 @@ where
///
/// let dq_normalized = dq.normalize();
///
/// relative_eq!(dq_normalized.real.norm(), 1.0);
/// assert_relative_eq!(dq_normalized.real.norm(), 1.0);
/// ```
#[inline]
#[must_use = "Did you mean to use normalize_mut()?"]
@ -122,7 +122,7 @@ where
///
/// dq.normalize_mut();
///
/// relative_eq!(dq.real.norm(), 1.0);
/// assert_relative_eq!(dq.real.norm(), 1.0);
/// ```
#[inline]
pub fn normalize_mut(&mut self) -> T {

View File

@ -138,7 +138,7 @@ where
/// # use nalgebra::Quaternion;
/// let q = Quaternion::new(1.0, 2.0, 3.0, 4.0);
/// let q_normalized = q.normalize();
/// relative_eq!(q_normalized.norm(), 1.0);
/// assert_relative_eq!(q_normalized.norm(), 1.0);
/// ```
#[inline]
#[must_use = "Did you mean to use normalize_mut()?"]

View File

@ -36,8 +36,8 @@ fn main() {
let angle = 1.57;
let b = Rotation3::from_axis_angle(&axis, angle);
relative_eq!(b.axis().unwrap(), axis);
relative_eq!(b.angle(), angle);
assert_relative_eq!(b.axis().unwrap(), axis);
assert_relative_eq!(b.angle(), angle);
}
```