]> git.lizzy.rs Git - rust.git/commit
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)
commit8794107f74682607f368776cc8b78820629778e6
tree989174ccb800fb13840b843ac246eeea0f1c9c1b
parent908c9e6a1b94674eee2727edb25dda58727a03b7
parent9040948ef39ed66a700a9dacfab29a8ddf723888
auto merge of #17754 : O-I/rust/update-guide, r=steveklabnik

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
src/doc/guide.md