about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-09-23 12:45:45 +0000
committerbors <bors@rust-lang.org>2014-09-23 12:45:45 +0000
commit2f9669c7489cc383bc6616c5f9ed217ae37e3d56 (patch)
tree18bd62a75b49ee80cbe65c77918d98a3269a2e40 /src
parent0a4c136d6a82ed57714b033029d6c4dd7ee4e2dc (diff)
parent9d95729af4af93bf32cad1acef00a5695078e77b (diff)
auto merge of #17456 : alfie/rust/master, r=steveklabnik
While reading the intro, I was confused as to why there were two variables named "numbers". Unless I'm mistaken and it's not necessary, let's get rid of it to make it clearer.
Diffstat (limited to 'src')
-rw-r--r--src/doc/intro.md6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/doc/intro.md b/src/doc/intro.md
index 503ea2b1bbe..14027b93419 100644
--- a/src/doc/intro.md
+++ b/src/doc/intro.md
@@ -300,8 +300,7 @@ Here's some code:
 use std::sync::Arc;
 
 fn main() {
-    let numbers = vec![1i, 2i, 3i];
-    let numbers = Arc::new(numbers);
+    let numbers = Arc::new(vec![1i, 2i, 3i]);
 
     for num in range(0u, 3) {
         let (tx, rx)  = channel();
@@ -346,8 +345,7 @@ and modify it to mutate the shared state:
 use std::sync::{Arc, Mutex};
 
 fn main() {
-    let numbers = vec![1i, 2i, 3i];
-    let numbers_lock = Arc::new(Mutex::new(numbers));
+    let numbers_lock = Arc::new(Mutex::new(vec![1i, 2i, 3i]));
 
     for num in range(0u, 3) {
         let (tx, rx)  = channel();