Skip to content

Commit 7cee92b

Browse files
committed
Address review comments.
1 parent 03048a2 commit 7cee92b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/expressions/struct-expr.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ let c3 = Color{1: 0, ..c2}; // Fill out all other fields using a base struct.
8989

9090
When initializing a data structure (struct, enum, union) with named (but not
9191
numbered) fields, it is allowed to write `fieldname` as a shorthand for
92-
`fieldname: fieldname`. This allows a compact syntax with less duplication. Example:
92+
`fieldname: fieldname`. This allows a compact syntax with less duplication.
93+
For example:
9394

9495
```rust
9596
# struct Point3d { x: i32, y: i32, z: i32 }
@@ -104,7 +105,7 @@ Point3d { x, y: y_value, z };
104105

105106
A struct expression with fields enclosed in parentheses constructs a tuple struct. Though
106107
it is listed here as a specific expression for completeness, it is equivalent to a [call
107-
expression] to the tuple struct's constructor. Example:
108+
expression] to the tuple struct's constructor. For example:
108109

109110
```rust
110111
struct Position(i32, i32, i32);
@@ -117,7 +118,7 @@ let pos = c(8, 6, 7); // Creates a `Position` value.
117118

118119
A unit struct expression is just the path to a unit struct item. This refers to the unit
119120
struct's implicit constant of its value. The unit struct value can also be constructed
120-
with fieldless struct expression. Example:
121+
with a fieldless struct expression. For example:
121122

122123
```rust
123124
struct Gamma;

0 commit comments

Comments
 (0)