diff options
| author | Nick Sarten <gen.battle@gmail.com> | 2015-02-01 18:37:01 +1300 |
|---|---|---|
| committer | Nick Sarten <gen.battle@gmail.com> | 2015-02-12 18:51:31 +1300 |
| commit | 5fa92225723a75f9bccef24d0716621ceb613d0f (patch) | |
| tree | dc571722638087ac56caf5a63493b83c83d432d5 /src/doc/reference.md | |
| parent | 3ef8ff1f81107b42840a695725e1a0869c163355 (diff) | |
| download | rust-5fa92225723a75f9bccef24d0716621ceb613d0f.tar.gz rust-5fa92225723a75f9bccef24d0716621ceb613d0f.zip | |
Updated documentation to use range notation syntax.
Replaced outdated use of the `range(start, end)` function where approriate with `start..end`, and tweaked the examples to compile and run with the latest rust. I also fixed two periphery compile issues in reference.md which were occluding whether there were any new errors created by these changes, so I fixed them.
Diffstat (limited to 'src/doc/reference.md')
| -rw-r--r-- | src/doc/reference.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md index 9c51f6bad6f..e1463249207 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -3005,7 +3005,7 @@ Some examples of call expressions: # fn add(x: i32, y: i32) -> i32 { 0 } let x: i32 = add(1i32, 2i32); -let pi: Option<f32> = "3.14".parse().ok(); +let pi: Option<f32> = "3.14".parse(); ``` ### Lambda expressions @@ -3148,7 +3148,7 @@ An example of a for loop over a series of integers: ``` # fn bar(b:usize) { } -for i in range(0us, 256) { +for i in 0us..256 { bar(i); } ``` @@ -3532,7 +3532,7 @@ An example of each kind: ```{rust} let vec: Vec<i32> = vec![1, 2, 3]; let arr: [i32; 3] = [1, 2, 3]; -let s: &[i32] = &vec; +let s: &[i32] = &vec[]; ``` As you can see, the `vec!` macro allows you to create a `Vec<T>` easily. The |
