Skip to content

Commit e76a184

Browse files
committed
Document guard expressions in matches!
1 parent f7ebe19 commit e76a184

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/libcore/macros.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,10 @@ macro_rules! debug_assert_ne {
238238
($($arg:tt)*) => (if $crate::cfg!(debug_assertions) { $crate::assert_ne!($($arg)*); })
239239
}
240240

241-
/// Returns whether the given expression matches (any of) the given pattern(s).
241+
/// Returns whether the given expression matches any of the given patterns.
242+
///
243+
/// Like in a `match` expression, the pattern can be optionally followed by `if`
244+
/// and a guard expression that has access to names bound by the pattern.
242245
///
243246
/// # Examples
244247
///

0 commit comments

Comments
 (0)