Repository: brendanzab/approx (language: rust)

Issue:
Documentation stil talks about `assert_approx_{eq, ne}!`
It should be `assert_relative_{eq, ne}!` instead.


Discussion / hints:
There is also mention of the `ApproxEq` trait, but it seems to have been renamed to `RelativeEq`(?)

Fix patch:
diff --git a/src/abs_diff_eq.rs b/src/abs_diff_eq.rs
index 67f59c7..ebcd6cf 100644
--- a/src/abs_diff_eq.rs
+++ b/src/abs_diff_eq.rs
@@ -14,15 +14,15 @@ where
 
     /// The default tolerance to use when testing values that are close together.
     ///
-    /// This is used when no `epsilon` value is supplied to the `abs_diff_eq!`, `relative_eq!`, or
-    /// `ulps_eq!` macros.
+    /// This is used when no `epsilon` value is supplied to the [`abs_diff_eq!`], [`relative_eq!`],
+    /// or [`ulps_eq!`] macros.
     fn default_epsilon() -> Self::Epsilon;
 
     /// A test for equality that uses the absolute difference to compute the approximate
     /// equality of two numbers.
     fn abs_diff_eq(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool;
 
-    /// The inverse of `ApproxEq::abs_diff_eq`.
+    /// The inverse of [`AbsDiffEq::abs_diff_eq`].
     fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool {
         !Self::abs_diff_eq(self, other, epsilon)
     }
diff --git a/src/lib.rs b/src/lib.rs
index a857f47..6220b49 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -16,8 +16,8 @@
 //! based types, using either relative difference, or units in the last place (ULPs)
 //! comparisons.
 //!
-//! You can also use the `approx_{eq, ne}!` `assert_approx_{eq, ne}!` macros to test for equality
-//! using a more positional style.
+//! You can also use the `*_{eq, ne}!` and `assert_*_{eq, ne}!` macros to test for equality using a
+//! more positional style:
 //!
 //! ```rust
 //! #[macro_use]
@@ -45,7 +45,7 @@
 //!
 //! # Implementing approximate equality for custom types
 //!
-//! The `ApproxEq` trait allows approximate equalities to be implemented on types, based on the
+//! The `*Eq` traits allow approximate equalities to be implemented on types, based on the
 //! fundamental floating point implementations.
 //!
 //! For example, we might want to be able to do approximate assertions on a complex number type:
@@ -92,9 +92,9 @@
 //! # }
 //! ```
 //!
-//! To do this we can implement `AbsDiffEq`, `RelativeEq` and `UlpsEq` generically in terms of a
-//! type parameter that also implements `ApproxEq`, `RelativeEq` and `UlpsEq` respectively. This
-//! means that we can make comparisons for either `Complex<f32>` or `Complex<f64>`:
+//! To do this we can implement [`AbsDiffEq`], [`RelativeEq`] and [`UlpsEq`] generically in terms
+//! of a type parameter that also implements `AbsDiffEq`, `RelativeEq` and `UlpsEq` respectively.
+//! This means that we can make comparisons for either `Complex<f32>` or `Complex<f64>`:
 //!
 //! ```rust
 //! # use approx::{AbsDiffEq, RelativeEq, UlpsEq};
@@ -148,11 +148,11 @@
 //! Floating point is hard! Thanks goes to these links for helping to make things a _little_
 //! easier to understand:
 //!
-//! - [Comparing Floating Point Numbers, 2012 Edition]
-//!   (https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/)
+//! - [Comparing Floating Point Numbers, 2012 Edition](
+//!   https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/)
 //! - [The Floating Point Guide - Comparison](http://floating-point-gui.de/errors/comparison/)
-//! - [What Every Computer Scientist Should Know About Floating-Point Arithmetic]
-//!   (https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html)
+//! - [What Every Computer Scientist Should Know About Floating-Point Arithmetic](
+//!   https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html)
 
 #![cfg_attr(not(feature = "std"), no_std)]
 
diff --git a/src/macros.rs b/src/macros.rs
index 6462fb2..d0fc81e 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -120,7 +120,7 @@ macro_rules! __assert_approx {
     }};
 }
 
-/// An assertion that delegates to `abs_diff_eq!`, and panics with a helpful error on failure.
+/// An assertion that delegates to [`abs_diff_eq!`], and panics with a helpful error on failure.
 #[macro_export(local_inner_macros)]
 macro_rules! assert_abs_diff_eq {
     ($given:expr, $expected:expr $(, $opt:ident = $val:expr)*) => {
@@ -131,7 +131,7 @@ macro_rules! assert_abs_diff_eq {
     };
 }
 
-/// An assertion that delegates to `abs_diff_ne!`, and panics with a helpful error on failure.
+/// An assertion that delegates to [`abs_diff_ne!`], and panics with a helpful error on failure.
 #[macro_export(local_inner_macros)]
 macro_rules! assert_abs_diff_ne {
     ($given:expr, $expected:expr $(, $opt:ident = $val:expr)*) => {
@@ -142,7 +142,7 @@ macro_rules! assert_abs_diff_ne {
     };
 }
 
-/// An assertion that delegates to `relative_eq!`, and panics with a helpful error on failure.
+/// An assertion that delegates to [`relative_eq!`], and panics with a helpful error on failure.
 #[macro_export(local_inner_macros)]
 macro_rules! assert_relative_eq {
     ($given:expr, $expected:expr $(, $opt:ident = $val:expr)*) => {
@@ -153,7 +153,7 @@ macro_rules! assert_relative_eq {
     };
 }
 
-/// An assertion that delegates to `relative_ne!`, and panics with a helpful error on failure.
+/// An assertion that delegates to [`relative_ne!`], and panics with a helpful error on failure.
 #[macro_export(local_inner_macros)]
 macro_rules! assert_relative_ne {
     ($given:expr, $expected:expr $(, $opt:ident = $val:expr)*) => {
@@ -164,7 +164,7 @@ macro_rules! assert_relative_ne {
     };
 }
 
-/// An assertion that delegates to `ulps_eq!`, and panics with a helpful error on failure.
+/// An assertion that delegates to [`ulps_eq!`], and panics with a helpful error on failure.
 #[macro_export(local_inner_macros)]
 macro_rules! assert_ulps_eq {
     ($given:expr, $expected:expr $(, $opt:ident = $val:expr)*) => {
@@ -175,7 +175,7 @@ macro_rules! assert_ulps_eq {
     };
 }
 
-/// An assertion that delegates to `ulps_ne!`, and panics with a helpful error on failure.
+/// An assertion that delegates to [`ulps_ne!`], and panics with a helpful error on failure.
 #[macro_export(local_inner_macros)]
 macro_rules! assert_ulps_ne {
     ($given:expr, $expected:expr $(, $opt:ident = $val:expr)*) => {
diff --git a/src/relative_eq.rs b/src/relative_eq.rs
index 5498825..2cf7cb7 100644
--- a/src/relative_eq.rs
+++ b/src/relative_eq.rs
@@ -14,7 +14,7 @@ where
 {
     /// The default relative tolerance for testing values that are far-apart.
     ///
-    /// This is used when no `max_relative` value is supplied to the `relative_eq` macro.
+    /// This is used when no `max_relative` value is supplied to the [`relative_eq`] macro.
     fn default_max_relative() -> Self::Epsilon;
 
     /// A test for equality that uses a relative comparison if the values are far apart.
@@ -25,7 +25,7 @@ where
         max_relative: Self::Epsilon,
     ) -> bool;
 
-    /// The inverse of `ApproxEq::relative_eq`.
+    /// The inverse of [`RelativeEq::relative_eq`].
     fn relative_ne(
         &self,
         other: &Rhs,
diff --git a/src/ulps_eq.rs b/src/ulps_eq.rs
index b177aaa..b17f62c 100644
--- a/src/ulps_eq.rs
+++ b/src/ulps_eq.rs
@@ -14,13 +14,13 @@ where
 {
     /// The default ULPs to tolerate when testing values that are far-apart.
     ///
-    /// This is used when no `max_ulps` value is supplied to the `ulps_eq` macro.
+    /// This is used when no `max_ulps` value is supplied to the [`ulps_eq`] macro.
     fn default_max_ulps() -> u32;
 
     /// A test for equality that uses units in the last place (ULP) if the values are far apart.
     fn ulps_eq(&self, other: &Rhs, epsilon: Self::Epsilon, max_ulps: u32) -> bool;
 
-    /// The inverse of `ApproxEq::ulps_eq`.
+    /// The inverse of [`UlpsEq::ulps_eq`].
     fn ulps_ne(&self, other: &Rhs, epsilon: Self::Epsilon, max_ulps: u32) -> bool {
         !Self::ulps_eq(self, other, epsilon, max_ulps)
     }


Test patch: