diff options
| author | Brendan Graetz <github@bguiz.com> | 2015-05-02 22:29:53 +1000 |
|---|---|---|
| committer | Brendan Graetz <github@bguiz.com> | 2015-05-02 22:29:53 +1000 |
| commit | 07ff8279bee968a61dd4b3e0999cbc650c96c809 (patch) | |
| tree | f28eab00cc05b2f579b04f089e9521d9e0b1c67b | |
| parent | 354d16bd72ed002d6d8abe9896f89a445a60c21f (diff) | |
| download | rust-07ff8279bee968a61dd4b3e0999cbc650c96c809.tar.gz rust-07ff8279bee968a61dd4b3e0999cbc650c96c809.zip | |
=BG= minor: ensure correct range bounds in concurreny examples in the rust book
- `0..2` iterates over `0,1` - `0..3` iterates over `0,1,2`, which is what we want instead
| -rw-r--r-- | src/doc/trpl/concurrency.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/doc/trpl/concurrency.md b/src/doc/trpl/concurrency.md index 575dfc7417a..3c64e0b14de 100644 --- a/src/doc/trpl/concurrency.md +++ b/src/doc/trpl/concurrency.md @@ -116,7 +116,7 @@ use std::thread; fn main() { let mut data = vec![1u32, 2, 3]; - for i in 0..2 { + for i in 0..3 { thread::spawn(move || { data[i] += 1; }); @@ -154,7 +154,7 @@ use std::sync::Mutex; fn main() { let mut data = Mutex::new(vec![1u32, 2, 3]); - for i in 0..2 { + for i in 0..3 { let data = data.lock().unwrap(); thread::spawn(move || { data[i] += 1; @@ -196,7 +196,7 @@ use std::thread; fn main() { let data = Arc::new(Mutex::new(vec![1u32, 2, 3])); - for i in 0..2 { + for i in 0..3 { let data = data.clone(); thread::spawn(move || { let mut data = data.lock().unwrap(); @@ -217,7 +217,7 @@ thread more closely: # use std::thread; # fn main() { # let data = Arc::new(Mutex::new(vec![1u32, 2, 3])); -# for i in 0..2 { +# for i in 0..3 { # let data = data.clone(); thread::spawn(move || { let mut data = data.lock().unwrap(); |
