diff options
| author | Son <leson.phung@gmail.com> | 2017-02-03 23:51:50 +1100 |
|---|---|---|
| committer | Son <leson.phung@gmail.com> | 2017-02-03 23:51:50 +1100 |
| commit | 4ddb56bf4dfdc607ae0bd2207da189c4c4d4c14a (patch) | |
| tree | 09475b93a7434eab57cf79dcca986d89dca9d7e0 /src/doc/reference.md | |
| parent | c4cd4e19d976240443ef31968e7b763cf83d6fdb (diff) | |
Simplify wording & fix test src/doc
Diffstat (limited to 'src/doc/reference.md')
| -rw-r--r-- | src/doc/reference.md | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md index 6f2ce5fd8d1..8139a712bdd 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -2770,8 +2770,13 @@ shorthand for `field: field`. Example: ``` -let a = SomeStruct { field1, field2: expression, field3 }; -let b = SomeStruct { field1: field1, field2: expression, field3: field3 }; +# #![feature(field_init_shorthand)] +# struct Point3d { x: i32, y: i32, z: i32 } +# let x = 0; +# let y_value = 0; +# let z = 0; +Point3d { x: x, y: y_value, z: z }; +Point3d { x, y: y_value, z }; ``` ### Block expressions |
