Skip to content

Commit 8642476

Browse files
Show what use_field_init_shorthand = true does
It did not include `b` for the `use_field_init_shorthand = true` case, which is a mistake as it is the one thing that will be changed by this option. The rather long examples were also made shorter by dropping `z`.
1 parent fd0ea74 commit 8642476

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

Configurations.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3020,15 +3020,13 @@ Use field initialize shorthand if possible.
30203020
struct Foo {
30213021
x: u32,
30223022
y: u32,
3023-
z: u32,
30243023
}
30253024

30263025
fn main() {
30273026
let x = 1;
30283027
let y = 2;
3029-
let z = 3;
3030-
let a = Foo { x, y, z };
3031-
let b = Foo { x: x, y: y, z: z };
3028+
let a = Foo { x, y };
3029+
let b = Foo { x: x, y: y };
30323030
}
30333031
```
30343032

@@ -3038,14 +3036,13 @@ fn main() {
30383036
struct Foo {
30393037
x: u32,
30403038
y: u32,
3041-
z: u32,
30423039
}
30433040

30443041
fn main() {
30453042
let x = 1;
30463043
let y = 2;
3047-
let z = 3;
3048-
let a = Foo { x, y, z };
3044+
let a = Foo { x, y };
3045+
let b = Foo { x, y };
30493046
}
30503047
```
30513048

0 commit comments

Comments
 (0)