]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #17754 : O-I/rust/update-guide, r=steveklabnik
authorbors <bors@rust-lang.org>
Sat, 4 Oct 2014 04:27:05 +0000 (04:27 +0000)
committerbors <bors@rust-lang.org>
Sat, 4 Oct 2014 04:27:05 +0000 (04:27 +0000)
Hi,

These are a few small edits to the Guide that I made while reading online. Really well done and approachable.

I have a few questions below, but I don't know if this is the proper place to ask them, so feel free to ignore the below.

1. Trailing commas seem to be a convention in Rust and are used quite a bit throughout the Guide, but are never explicitly mentioned. Maybe adding a short mention about them when they first appear in the Structs section might be helpful to those who are unfamiliar with or don't use them in other languages.

2. In the Iterators section, there is a block of code like this:

```rust
let mut range = range(0i, 10i);

loop {
    match range.next() {
        Some(x) => {
            println!("{}", x);
        }  // no comma needed?
        None => { break }
    }
}
```

My inclination would be to put a comma where the comment is to separate the two arms to get this to compile, but it runs fine either way. Is there a convention on commas for scenarios like this where each arm is enclosed in `{}`?

All the best,
O-I

1  2 
src/doc/guide.md

Simple merge