Skip to content

Commit c4cd4e1

Browse files
committed
Wrap 80 columns
1 parent a7b65f1 commit c4cd4e1

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/doc/book/structs.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ fn main() {
117117
}
118118
```
119119

120-
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:
120+
We can initializing a data structure (struct, enum, union) with named fields,
121+
by writing `fieldname` as a shorthand for `fieldname: fieldname`. This allows a
122+
compact syntax for initialization, with less duplication:
121123

122124
```
123125
#![feature(field_init_shorthand)]
@@ -133,7 +135,7 @@ fn main() {
133135
let name = "Peter";
134136
let age = 27;
135137
let peter = Person { name, age };
136-
138+
137139
// Print debug struct
138140
println!("{:?}", peter);
139141
}

src/doc/reference.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2759,9 +2759,13 @@ Point3d {y: 0, z: 10, .. base};
27592759

27602760
#### Struct field init shorthand
27612761

2762-
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.
2762+
When initializing a data structure (struct, enum, union) with named fields,
2763+
allow writing `fieldname` as a shorthand for `fieldname: fieldname`. This
2764+
allows a compact syntax for initialization, with less duplication.
27632765

2764-
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`.
2766+
In the initializer for a `struct` with named fields, a `union` with named
2767+
fields, or an enum variant with named fields, accept an identifier `field` as a
2768+
shorthand for `field: field`.
27652769

27662770
Example:
27672771

0 commit comments

Comments
 (0)