Skip to content

Commit 2f04c5b

Browse files
committed
Fix the wording of the first few paragraphs of the crate documentation.
This reduces duplication in the description of the evaluation target of `verify_that!` and fixes the link behind `Result<()>`. It also makes the links to `std::result::Result` explicit to avoid confusion with `googletest::Result`.
1 parent be4e5d2 commit 2f04c5b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

googletest/src/lib.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
//!
2424
//! ## Assertions and matchers
2525
//!
26-
//! Most assertions are made through the macro [`verify_that!`] which evaluates
27-
//! to a [`Result<()>`]. It takes two arguments: an actual value to be tested
28-
//! and a [`Matcher`].
26+
//! Most assertions are made through the macro [`verify_that!`]. It takes two
27+
//! arguments: an actual value to be tested and a [`Matcher`].
2928
//!
3029
//! Unlike the macros used in other test assertion libraries in Rust,
3130
//! `verify_that!` does not panic when the test assertion fails. Instead, it
32-
//! evaluates to `Result`, which the caller can choose to handle by:
31+
//! evaluates to [`googletest::Result<()>`][Result], which the caller can choose
32+
//! to handle by:
3333
//!
3434
//! * Returning immediately from the function with the `?` operator (a *fatal*
3535
//! assertion), or
@@ -107,7 +107,7 @@
107107
//! | [`empty`] | An empty collection. |
108108
//! | [`ends_with`] | A string ending with the given suffix. |
109109
//! | [`eq`] | A value equal to the argument, in the sense of the [`PartialEq`] trait. |
110-
//! | [`err`] | A [`Result`] containing an `Err` variant the argument matches. |
110+
//! | [`err`] | A [`Result`][std::result::Result] containing an `Err` variant the argument matches. |
111111
//! | [`field!`] | A struct or enum with a given field whose value the argument matches. |
112112
//! | [`ge`] | A [`PartialOrd`] value greater than or equal to the given value. |
113113
//! | [`gt`] | A [`PartialOrd`] value strictly greater than the given value. |
@@ -121,7 +121,7 @@
121121
//! | [`near`] | A floating point number within a given tolerance of the argument. |
122122
//! | [`none`] | An [`Option`] containing `None`. |
123123
//! | [`not`] | Any value the argument does not match. |
124-
//! | [`ok`] | A [`Result`] containing an `Ok` variant the argument matches. |
124+
//! | [`ok`] | A [`Result`][std::result::Result] containing an `Ok` variant the argument matches. |
125125
//! | [`or`] | Anything matched by either of the two given matchers. |
126126
//! | [`pat!`] | Alias for [`matches_pattern!`]. |
127127
//! | [`points_to`] | Any [`Deref`] such as `&`, `Rc`, etc. whose value the argument matches. |
@@ -174,7 +174,6 @@
174174
//! [`Option`]: std::option::Option
175175
//! [`PartialEq`]: std::cmp::PartialEq
176176
//! [`PartialOrd`]: std::cmp::PartialOrd
177-
//! [`Result`]: std::result::Result
178177
//!
179178
//! ## Writing matchers
180179
//!

0 commit comments

Comments
 (0)