|
2 | 2 |
|
3 | 3 | ## Single line formatting |
4 | 4 |
|
5 | | -* `[T]` no spaces |
6 | | -* `[T; expr]`, e.g., `[u32; 42]`, `[Vec<Foo>; 10 * 2 + foo()]` (space after colon, no spaces around square brackets) |
7 | | -* `*const T`, `*mut T` (no space after `*`, space before type) |
8 | | -* `&'a T`, `&T`, `&'a mut T`, `&mut T` (no space after `&`, single spaces separating other words) |
9 | | -* `unsafe extern "C" fn<'a, 'b, 'c>(T, U, V) -> W` or `fn()` (single spaces around keywords and sigils, and after commas, no trailing commas, no spaces around brackets) |
10 | | -* `!` gets treated like any other type name, `Name` |
11 | | -* `(A, B, C, D)` (spaces after commas, no spaces around parens, no trailing comma unless it is a one-tuple) |
12 | | -* `<Baz<T> as SomeTrait>::Foo::Bar` or `Foo::Bar` or `::Foo::Bar` (no spaces around `::` or angle brackets, single spaces around `as`) |
13 | | -* `Foo::Bar<T, U, V>` (spaces after commas, no trailing comma, no spaces around angle brackets) |
14 | | -* `T + T + T` (single spaces between types, and `+`). |
15 | | -* `impl T + T + T` (single spaces between keyword, types, and `+`). |
| 5 | +- `[T]` no spaces |
| 6 | +- `[T; expr]`, e.g., `[u32; 42]`, `[Vec<Foo>; 10 * 2 + foo()]` (space after colon, no spaces around square brackets) |
| 7 | +- `*const T`, `*mut T` (no space after `*`, space before type) |
| 8 | +- `&'a T`, `&T`, `&'a mut T`, `&mut T` (no space after `&`, single spaces separating other words) |
| 9 | +- `unsafe extern "C" fn<'a, 'b, 'c>(T, U, V) -> W` or `fn()` (single spaces around keywords and sigils, and after commas, no trailing commas, no spaces around brackets) |
| 10 | +- `!` gets treated like any other type name, `Name` |
| 11 | +- `(A, B, C, D)` (spaces after commas, no spaces around parens, no trailing comma unless it is a one-tuple) |
| 12 | +- `<Baz<T> as SomeTrait>::Foo::Bar` or `Foo::Bar` or `::Foo::Bar` (no spaces around `::` or angle brackets, single spaces around `as`) |
| 13 | +- `Foo::Bar<T, U, V>` (spaces after commas, no trailing comma, no spaces around angle brackets) |
| 14 | +- `T + T + T` (single spaces between types, and `+`). |
| 15 | +- `impl T + T + T` (single spaces between keyword, types, and `+`). |
16 | 16 |
|
17 | 17 | Do not put space around parentheses used in types, e.g., `(Foo)` |
18 | 18 |
|
|
0 commit comments