about summary refs log tree commit diff
path: root/src/doc/trpl
diff options
context:
space:
mode:
authorAaron Turon <aturon@mozilla.com>2015-01-21 11:16:00 -0800
committerAaron Turon <aturon@mozilla.com>2015-01-21 11:16:00 -0800
commit537889aa78c984ee6484d16fec4a67f35778aec6 (patch)
tree275a624afad3249473407eca83548f3bcb6e46fa /src/doc/trpl
parentda8023d653618431f8e1c651e0c3b83fa0d4269a (diff)
downloadrust-537889aa78c984ee6484d16fec4a67f35778aec6.tar.gz
rust-537889aa78c984ee6484d16fec4a67f35778aec6.zip
Fix type inference problems in tests and docs
Diffstat (limited to 'src/doc/trpl')
-rw-r--r--src/doc/trpl/looping.md2
-rw-r--r--src/doc/trpl/threads.md4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/doc/trpl/looping.md b/src/doc/trpl/looping.md
index 28f02b1ffe1..4301149d1f8 100644
--- a/src/doc/trpl/looping.md
+++ b/src/doc/trpl/looping.md
@@ -123,7 +123,7 @@ We now loop forever with `loop` and use `break` to break out early.
 iteration. This will only print the odd numbers:
 
 ```{rust}
-for x in 0..10 {
+for x in 0u32..10 {
     if x % 2 == 0 { continue; }
 
     println!("{}", x);
diff --git a/src/doc/trpl/threads.md b/src/doc/trpl/threads.md
index 1bad09b4b6e..a801a1ab0e9 100644
--- a/src/doc/trpl/threads.md
+++ b/src/doc/trpl/threads.md
@@ -179,7 +179,7 @@ for init_val in 0 .. 3 {
 }
 
 let result = rx.recv().unwrap() + rx.recv().unwrap() + rx.recv().unwrap();
-# fn some_expensive_computation(_i: u32) -> u32 { 42 }
+# fn some_expensive_computation(_i: i32) -> i32 { 42 }
 ```
 
 Cloning a `Sender` produces a new handle to the same channel, allowing multiple
@@ -207,7 +207,7 @@ let rxs = (0 .. 3).map(|&:init_val| {
 
 // Wait on each port, accumulating the results
 let result = rxs.iter().fold(0, |&:accum, rx| accum + rx.recv().unwrap() );
-# fn some_expensive_computation(_i: u32) -> u32 { 42 }
+# fn some_expensive_computation(_i: i32) -> i32 { 42 }
 ```
 
 ## Backgrounding computations: Futures