}
```
-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)]
let name = "Peter";
let age = 27;
let peter = Person { name, age };
-
+
// Print debug struct
println!("{:?}", peter);
}
#### 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: