summaryrefslogtreecommitdiff
path: root/src/doc/reference.md
diff options
context:
space:
mode:
authorJake Goulding <jake.goulding@gmail.com>2017-02-11 23:42:39 -0500
committerJake Goulding <jake.goulding@gmail.com>2017-02-11 23:42:39 -0500
commit037ef0bbc88742187e6059a846f027bb99884267 (patch)
tree9dd7e140bbeb7ec2a26ed02ef4cc8a4ff7d734ab /src/doc/reference.md
parentba7cf7cc5daefb9f28371b8be87dc262fb55937c (diff)
downloadrust-037ef0bbc88742187e6059a846f027bb99884267.tar.gz
Improve grammar on field init docs
Diffstat (limited to 'src/doc/reference.md')
-rw-r--r--src/doc/reference.md8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md
index 8aefabe61fd..ab4da862033 100644
--- a/src/doc/reference.md
+++ b/src/doc/reference.md
@@ -2819,12 +2819,8 @@ Point3d {y: 0, z: 10, .. base};
#### Struct field init shorthand
When initializing a data structure (struct, enum, union) with named fields,
-allow writing `fieldname` as a shorthand for `fieldname: fieldname`. This
-allows a compact syntax for initialization, with less duplication.
-
-In the initializer for a `struct` with named fields, a `union` with named
-fields, or an enum variant with named fields, accept an identifier `field` as a
-shorthand for `field: field`.
+it is allowed to write `fieldname` as a shorthand for `fieldname: fieldname`.
+This allows a compact syntax with less duplication.
Example: