diff --git a/src/doc/trpl/concurrency.md b/src/doc/trpl/concurrency.md index 575dfc7417a7f..3c64e0b14de42 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();