]> git.lizzy.rs Git - rust.git/commitdiff
Update unstable book wrt. subslice patterns.
authorMazdak Farrokhzad <twingoow@gmail.com>
Wed, 10 Jul 2019 03:16:47 +0000 (05:16 +0200)
committerMazdak Farrokhzad <twingoow@gmail.com>
Sun, 28 Jul 2019 04:53:39 +0000 (06:53 +0200)
src/doc/unstable-book/src/language-features/slice-patterns.md

index 00c81f03ba17394be62146924357395aa5a0d194..cdb74495884a8e6e8d027992e147814ed44946ee 100644 (file)
@@ -17,7 +17,7 @@ matched against that pattern. For example:
 fn is_symmetric(list: &[u32]) -> bool {
     match list {
         &[] | &[_] => true,
-        &[x, ref inside.., y] if x == y => is_symmetric(inside),
+        &[x, ref inside @ .., y] if x == y => is_symmetric(inside),
         &[..] => false,
     }
 }