about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2015-04-10 12:21:14 -0400
committerSteve Klabnik <steve@steveklabnik.com>2015-04-10 12:26:58 -0400
commit8d35fc6303195c0f47c8eb0bc5f9da0ce0073b1f (patch)
tree125e1a10b5b6afd3a2d6bee45c40fe27d6d89f2c
parentb577beeb3a006f68cf8df25e7c77bb13a7803f26 (diff)
downloadrust-8d35fc6303195c0f47c8eb0bc5f9da0ce0073b1f.tar.gz
rust-8d35fc6303195c0f47c8eb0bc5f9da0ce0073b1f.zip
copyediting: for loops
-rw-r--r--src/doc/trpl/for-loops.md29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/doc/trpl/for-loops.md b/src/doc/trpl/for-loops.md
index ad68e70f41f..1e3f2fa54bc 100644
--- a/src/doc/trpl/for-loops.md
+++ b/src/doc/trpl/for-loops.md
@@ -1,10 +1,10 @@
 % for Loops
 
-The `for` loop is used to loop a particular number of times. Rust's `for` loops
-work a bit differently than in other systems languages, however. Rust's `for`
-loop doesn't look like this "C-style" `for` loop:
+The `for` loop is used to loop a particular number of times. Rust’s `for` loops
+work a bit differently than in other systems languages, however. Rust’s `for`
+loop doesn’t look like this “C-style” `for` loop:
 
-```{c}
+```c
 for (x = 0; x < 10; x++) {
     printf( "%d\n", x );
 }
@@ -12,7 +12,7 @@ for (x = 0; x < 10; x++) {
 
 Instead, it looks like this:
 
-```{rust}
+```rust
 for x in 0..10 {
     println!("{}", x); // x: i32
 }
@@ -20,25 +20,24 @@ for x in 0..10 {
 
 In slightly more abstract terms,
 
-```{ignore}
+```ignore
 for var in expression {
     code
 }
 ```
 
-The expression is an iterator, which we will discuss in more depth later in the
-guide. The iterator gives back a series of elements. Each element is one
-iteration of the loop. That value is then bound to the name `var`, which is
-valid for the loop body. Once the body is over, the next value is fetched from
-the iterator, and we loop another time. When there are no more values, the
-`for` loop is over.
+The expression is an [iterator][iterator]. The iterator gives back a series of
+elements. Each element is one iteration of the loop. That value is then bound
+to the name `var`, which is valid for the loop body. Once the body is over, the
+next value is fetched from the iterator, and we loop another time. When there
+are no more values, the `for` loop is over.
+
+[iterator]: iterators.html
 
 In our example, `0..10` is an expression that takes a start and an end position,
 and gives an iterator over those values. The upper bound is exclusive, though,
 so our loop will print `0` through `9`, not `10`.
 
-Rust does not have the "C-style" `for` loop on purpose. Manually controlling
+Rust does not have the “C-style” `for` loop on purpose. Manually controlling
 each element of the loop is complicated and error prone, even for experienced C
 developers.
-
-We'll talk more about `for` when we cover *iterators*, later in the Guide.