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

Commit 63c8a2d

Browse files
committed
Merge pull request #16 from prsteele/master
Not using whitespace for mid-line alignment.
2 parents 329085c + dbf8fdc commit 63c8a2d

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

style/whitespace.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,31 @@ foo_bar(x, y, |z| {
103103
> }
104104
> }
105105
> ```
106+
107+
### Alignment
108+
109+
Idiomatic code should not use extra whitespace in the middle of a line
110+
to provide alignment.
111+
112+
113+
``` rust
114+
// Good
115+
struct Foo {
116+
short: f64,
117+
really_long: f64,
118+
}
119+
120+
// Bad
121+
struct Bar {
122+
short: f64,
123+
really_long: f64,
124+
}
125+
126+
// Good
127+
let a = 0;
128+
let radius = 7;
129+
130+
// Bad
131+
let b = 0;
132+
let diameter = 7;
133+
```

0 commit comments

Comments
 (0)