diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-09-17 08:49:06 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-09-17 08:49:06 -0700 |
| commit | b4bff574d2e40ca71a07b661854df894f6a16eef (patch) | |
| tree | b1f6df814075d89bcca830f95bcf86829431406f | |
| parent | e8a3ac5cb08cc7dc210c6b86abcb4669588e7111 (diff) | |
| parent | 51b4c515f485b5d8a762d4821a6344d37ecd6898 (diff) | |
| download | rust-b4bff574d2e40ca71a07b661854df894f6a16eef.tar.gz rust-b4bff574d2e40ca71a07b661854df894f6a16eef.zip | |
rollup merge of #17277 : steveklabnik/doc_fix_rollup
| -rw-r--r-- | src/doc/guide.md | 21 | ||||
| -rw-r--r-- | src/doc/index.md | 8 |
2 files changed, 12 insertions, 17 deletions
diff --git a/src/doc/guide.md b/src/doc/guide.md index cf97cc3ab64..4bfe3854dba 100644 --- a/src/doc/guide.md +++ b/src/doc/guide.md @@ -392,14 +392,10 @@ By the way, in these examples, `i` indicates that the number is an integer. Rust is a statically typed language, which means that we specify our types up front. So why does our first example compile? Well, Rust has this thing called -"[Hindley-Milner type -inference](http://en.wikipedia.org/wiki/Hindley%E2%80%93Milner_type_system)", -named after some really smart type theorists. If you clicked that link, don't -be scared: what this means for you is that Rust will attempt to infer the types -in your program, and it's pretty good at it. If it can infer the type, Rust +"type inference." If it can figure out what the type of something is, Rust doesn't require you to actually type it out. -We can add the type if we want to. Types come after a colon (`:`): +We can add the type if we want to, though. Types come after a colon (`:`): ```{rust} let x: int = 5; @@ -1281,15 +1277,15 @@ two main looping constructs: `for` and `while`. 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 `for` loop: +loop doesn't look like this "C style" `for` loop: -```{ignore,c} +```{c} for (x = 0; x < 10; x++) { printf( "%d\n", x ); } ``` -It looks like this: +Instead, it looks like this: ```{rust} for x in range(0i, 10i) { @@ -1312,10 +1308,9 @@ 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. -In our example, the `range` function is a function, provided by Rust, 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`. +In our example, `range` is a function 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 each element of the loop is complicated and error prone, even for experienced C diff --git a/src/doc/index.md b/src/doc/index.md index 475c3b748db..f237bc2ddbc 100644 --- a/src/doc/index.md +++ b/src/doc/index.md @@ -86,10 +86,10 @@ There are questions that are asked quite often, and so we've made FAQs for them: # The standard library -You can find function-level documentation for the entire standard library -[here](std/index.html). There's a list of crates on the left with more specific -sections, or you can use the search bar at the top to search for something if -you know its name. +We have [API documentation for the entire standard +library](std/index.html). There's a list of crates on the left with more +specific sections, or you can use the search bar at the top to search for +something if you know its name. # External documentation |
