about summary refs log tree commit diff
path: root/src/doc/tutorial.md
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2014-09-06 15:23:55 -0700
committerPatrick Walton <pcwalton@mimiga.net>2014-09-08 16:12:13 -0700
commiteb678ff87f0cdbf523b26fe9255cff684b4091e5 (patch)
tree9fb3745051a57fd5f73d6d50aabf07ce9d2f6ea4 /src/doc/tutorial.md
parent6f34760e4173dda94162502153fe4c5a2a96fc9d (diff)
downloadrust-eb678ff87f0cdbf523b26fe9255cff684b4091e5.tar.gz
rust-eb678ff87f0cdbf523b26fe9255cff684b4091e5.zip
librustc: Change the syntax of subslice matching to use postfix `..`
instead of prefix `..`.

This breaks code that looked like:

    match foo {
        [ first, ..middle, last ] => { ... }
    }

Change this code to:

    match foo {
        [ first, middle.., last ] => { ... }
    }

RFC #55.

Closes #16967.

[breaking-change]
Diffstat (limited to 'src/doc/tutorial.md')
-rw-r--r--src/doc/tutorial.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/doc/tutorial.md b/src/doc/tutorial.md
index 0db25c4090e..0e5a624b273 100644
--- a/src/doc/tutorial.md
+++ b/src/doc/tutorial.md
@@ -1707,7 +1707,7 @@ let score = match numbers {
     [] => 0,
     [a] => a * 10,
     [a, b] => a * 6 + b * 4,
-    [a, b, c, ..rest] => a * 5 + b * 3 + c * 2 + rest.len() as int
+    [a, b, c, rest..] => a * 5 + b * 3 + c * 2 + rest.len() as int
 };
 ~~~~