Merge pull request #2224 from kbacha/issue-2220

Combine 3 repeated sections into a single section
This commit is contained in:
Nick Cameron 2017-12-03 14:24:33 +13:00 committed by GitHub
commit 36d1bd7d13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1526,7 +1526,7 @@ let lorem = 0 .. 10;
## `spaces_within_parens_and_brackets`
Put spaces within non-empty generic arguments
Put spaces within non-empty generic arguments, parentheses, and square brackets
- **Default value**: `false`
- **Possible values**: `true`, `false`
@ -1534,67 +1534,37 @@ Put spaces within non-empty generic arguments
#### `false` (default):
```rust
// generic arguments
fn lorem<T: Eq>(t: T) {
// body
}
```
#### `true`:
```rust
fn lorem< T: Eq >(t: T) {
// body
}
```
See also: [`spaces_within_parens_and_brackets`](#spaces_within_parens_and_brackets), [`spaces_within_parens_and_brackets`](#spaces_within_parens_and_brackets).
## `spaces_within_parens_and_brackets`
Put spaces within non-empty parentheses
- **Default value**: `false`
- **Possible values**: `true`, `false`
#### `false` (default):
```rust
// non-empty parentheses
fn lorem<T: Eq>(t: T) {
let lorem = (ipsum, dolor);
}
```
#### `true`:
```rust
fn lorem<T: Eq>( t: T ) {
let lorem = ( ipsum, dolor );
}
```
See also: [`spaces_within_parens_and_brackets`](#spaces_within_parens_and_brackets), [`spaces_within_parens_and_brackets`](#spaces_within_parens_and_brackets).
## `spaces_within_parens_and_brackets`
Put spaces within non-empty square brackets
- **Default value**: `false`
- **Possible values**: `true`, `false`
#### `false` (default):
```rust
// non-empty square brackets
let lorem: [usize; 2] = [ipsum, dolor];
```
#### `true`:
```rust
// generic arguments
fn lorem< T: Eq >(t: T) {
// body
}
// non-empty parentheses
fn lorem<T: Eq>( t: T ) {
let lorem = ( ipsum, dolor );
}
// non-empty square brackets
let lorem: [ usize; 2 ] = [ ipsum, dolor ];
```
See also: [`spaces_within_parens_and_brackets`](#spaces_within_parens_and_brackets), [`spaces_within_parens_and_brackets`](#spaces_within_parens_and_brackets).
## `struct_lit_single_line`
Put small struct literals on a single line