@@ -118,7 +118,7 @@ macro_rules! assert_ne {
118
118
/// the debug representation, of the actual value shape that did not meet expectation. In contrast
119
119
/// using [`assert!`] will only print that the expectation was not met, but not why.
120
120
///
121
- /// The pattern syntax is exactly the same as found in a match arm and the [ `matches!`] macro. The
121
+ /// The pattern syntax is exactly the same as found in a match arm and the `matches!` macro. The
122
122
/// optional if guard can be used to add additional checks that must be true for the matched value,
123
123
/// otherwise this macro will panic.
124
124
///
@@ -385,7 +385,7 @@ macro_rules! debug_assert_ne {
385
385
/// print the debug representation, of the actual value shape that did not meet expectation. In
386
386
/// contrast using [`debug_assert!`] will only print that the expectation was not met, but not why.
387
387
///
388
- /// The pattern syntax is exactly the same as found in a match arm and the [ `matches!`] macro. The
388
+ /// The pattern syntax is exactly the same as found in a match arm and the `matches!` macro. The
389
389
/// optional if guard can be used to add additional checks that must be true for the matched value,
390
390
/// otherwise this macro will panic.
391
391
///
@@ -430,10 +430,15 @@ pub macro debug_assert_matches($($arg:tt)*) {
430
430
}
431
431
}
432
432
433
- /// Returns whether the given expression matches any of the given patterns .
433
+ /// Returns whether the given expression matches the provided pattern .
434
434
///
435
- /// Like in a `match` expression, the pattern can be optionally followed by `if`
436
- /// and a guard expression that has access to names bound by the pattern.
435
+ /// The pattern syntax is exactly the same as found in a match arm. The optional if guard can be
436
+ /// used to add additional checks that must be true for the matched value, otherwise this macro will
437
+ /// return `false`.
438
+ ///
439
+ /// When testing that a value matches a pattern, it's generally preferable to use
440
+ /// [`assert_matches!`] as it will print the debug representation of the value if the assertion
441
+ /// fails.
437
442
///
438
443
/// # Examples
439
444
///
0 commit comments