From 7e2b9ea235c2bf4cc9a7575c8e0f70950208b8f2 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Tue, 30 Dec 2014 21:19:41 +1300 Subject: Fallout - change array syntax to use `;` --- src/doc/reference.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/doc/reference.md') diff --git a/src/doc/reference.md b/src/doc/reference.md index 94c76aaa695..f3ad19bbd2a 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -1438,11 +1438,11 @@ the `static` lifetime, fixed-size arrays, tuples, enum variants, and structs. const BIT1: uint = 1 << 0; const BIT2: uint = 1 << 1; -const BITS: [uint, ..2] = [BIT1, BIT2]; +const BITS: [uint; 2] = [BIT1, BIT2]; const STRING: &'static str = "bitstring"; struct BitsNStrings<'a> { - mybits: [uint, ..2], + mybits: [uint; 2], mystring: &'a str } @@ -2923,7 +2923,7 @@ constant expression that can be evaluated at compile time, such as a ``` [1i, 2, 3, 4]; ["a", "b", "c", "d"]; -[0i, ..128]; // array with 128 zeros +[0i; 128]; // array with 128 zeros [0u8, 0u8, 0u8, 0u8]; ``` @@ -3691,7 +3691,7 @@ An example of each kind: ```{rust} let vec: Vec = vec![1, 2, 3]; -let arr: [int, ..3] = [1, 2, 3]; +let arr: [int; 3] = [1, 2, 3]; let s: &[int] = vec.as_slice(); ``` -- cgit 1.4.1-3-g733a5