Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize range syntax used in concurrency.md #22324

Merged
merged 1 commit into from
Feb 16, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/doc/trpl/concurrency.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ use std::time::Duration;
fn main() {
let mut data = vec![1u32, 2, 3];

for i in 0 .. 2 {
for i in 0..2 {
Thread::spawn(move || {
data[i] += 1;
});
Expand Down Expand Up @@ -211,7 +211,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..2 {
let data = data.lock().unwrap();
Thread::spawn(move || {
data[i] += 1;
Expand Down Expand Up @@ -262,7 +262,7 @@ use std::time::Duration;
fn main() {
let data = Arc::new(Mutex::new(vec![1u32, 2, 3]));

for i in (0us..2) {
for i in 0us..2 {
let data = data.clone();
Thread::spawn(move || {
let mut data = data.lock().unwrap();
Expand All @@ -285,7 +285,7 @@ thread more closely:
# use std::time::Duration;
# fn main() {
# let data = Arc::new(Mutex::new(vec![1u32, 2, 3]));
# for i in (0us..2) {
# for i in 0us..2 {
# let data = data.clone();
Thread::spawn(move || {
let mut data = data.lock().unwrap();
Expand Down Expand Up @@ -323,7 +323,7 @@ fn main() {

let (tx, rx) = mpsc::channel();

for _ in (0..10) {
for _ in 0..10 {
let (data, tx) = (data.clone(), tx.clone());

Thread::spawn(move || {
Expand All @@ -334,7 +334,7 @@ fn main() {
});
}

for _ in 0 .. 10 {
for _ in 0..10 {
rx.recv();
}
}
Expand Down