This repository was archived by the owner on Oct 9, 2018. It is now read-only.

Description
The guidelines say "Opening braces always go on the same line.", but in some situations (complex match inputs or iterator chains), readability increases when the opening curly bracket is moved to the next line:
Compare these two
for (x, y) in range(0u, 3)
.flat_map(|e| Repeat::new(e).zip(range(0u, 3)))
.flat_map(|e| Repeat::new(e).zip(OFFSETS.iter()))
.map(|((x,y), &(x1,y1))| (x + x1, y + y1)) {
grid.get_mut(y)
.and_then(|row| row.get_mut(x))
.map(|tile| *tile += 1);
}
for (x, y) in range(0u, 3)
.flat_map(|e| Repeat::new(e).zip(range(0u, 3)))
.flat_map(|e| Repeat::new(e).zip(OFFSETS.iter()))
.map(|((x,y), &(x1,y1))| (x + x1, y + y1))
{
grid.get_mut(y)
.and_then(|row| row.get_mut(x))
.map(|tile| *tile += 1);
}
Or
match (rng.gen::<bool>(),
rng.gen::<bool>(),
rng.gen::<bool>()) {
(true,true,true) => { ... },
...
}
match (rng.gen::<bool>(),
rng.gen::<bool>(),
rng.gen::<bool>())
{
(true,true,true) => { ... },
...
}