]> git.lizzy.rs Git - rust.git/commitdiff
Wrap 80 columns
authorSon <leson.phung@gmail.com>
Thu, 2 Feb 2017 11:24:50 +0000 (22:24 +1100)
committerSon <leson.phung@gmail.com>
Thu, 2 Feb 2017 11:24:50 +0000 (22:24 +1100)
src/doc/book/structs.md
src/doc/reference.md

index 5a13746d0a87f2ad2a8ccdab8ff6db7769940704..811f7b4196768f3185e841168d9dca528675287d 100644 (file)
@@ -117,7 +117,9 @@ fn main() {
 }
 ```
 
-We can initializing a data structure (struct, enum, union) with named fields, by writing `fieldname` as a shorthand for `fieldname: fieldname`. This allows a compact syntax for initialization, with less duplication:
+We can initializing a data structure (struct, enum, union) with named fields,
+by writing `fieldname` as a shorthand for `fieldname: fieldname`. This allows a
+compact syntax for initialization, with less duplication:
 
 ```
 #![feature(field_init_shorthand)]
@@ -133,7 +135,7 @@ fn main() {
     let name = "Peter";
     let age = 27;
     let peter = Person { name, age };
-    
+
     // Print debug struct
     println!("{:?}", peter);
 }
index 32e0f9bbed8d9d3e9e5ec9b25731e46f6364b9c3..6f2ce5fd8d1c50db48ba1daa061dddfa5a68f599 100644 (file)
@@ -2759,9 +2759,13 @@ 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.
+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`.
+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`.
 
 Example: