Skip to content

Commit

Permalink
Replace '*' by '..' in the doc of pattern matching
Browse files Browse the repository at this point in the history
  • Loading branch information
Armavica committed Jan 24, 2014
1 parent 2b62371 commit 2c5b04c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/rust.md
Expand Up @@ -2865,7 +2865,7 @@ match_pat : pat [ ".." pat ] ? [ "if" expr ] ;
A `match` expression branches on a *pattern*. The exact form of matching that
occurs depends on the pattern. Patterns consist of some combination of
literals, destructured enum constructors, structures, records and tuples, variable binding
specifications, wildcards (`*`), and placeholders (`_`). A `match` expression has a *head
specifications, wildcards (`..`), and placeholders (`_`). A `match` expression has a *head
expression*, which is the value to compare to the patterns. The type of the
patterns must equal the type of the head expression.

Expand All @@ -2887,7 +2887,7 @@ match x {

The first pattern matches lists constructed by applying `Cons` to any head value, and a
tail value of `~Nil`. The second pattern matches _any_ list constructed with `Cons`,
ignoring the values of its arguments. The difference between `_` and `*` is that the pattern
ignoring the values of its arguments. The difference between `_` and `..` is that the pattern
`C(_)` is only type-correct if `C` has exactly one argument, while the pattern `C(..)` is
type-correct for any enum variant `C`, regardless of how many arguments `C` has.

Expand Down

0 comments on commit 2c5b04c

Please sign in to comment.