Skip to content

Commit 7f43c57

Browse files
committed
TRPL editing: structs
1 parent 44db46a commit 7f43c57

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/doc/trpl/structs.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% Structs
22

3-
Structs are a way of creating more complex datatypes. For example, if we were
3+
Structs are a way of creating more complex data types. For example, if we were
44
doing calculations involving coordinates in 2D space, we would need both an `x`
55
and a `y` value:
66

@@ -24,12 +24,12 @@ fn main() {
2424
}
2525
```
2626

27-
There’s a lot going on here, so let’s break it down. We declare a struct with
28-
the `struct` keyword, and then with a name. By convention, structs begin with a
29-
capital letter and are also camel cased: `PointInSpace`, not `Point_In_Space`.
27+
There’s a lot going on here, so let’s break it down. We declare a `struct` with
28+
the `struct` keyword, and then with a name. By convention, `struct`s begin with
29+
a capital letter and are camel cased: `PointInSpace`, not `Point_In_Space`.
3030

3131
We can create an instance of our struct via `let`, as usual, but we use a `key:
32-
value` style syntax to set each field. The order doesn't need to be the same as
32+
value` style syntax to set each field. The order doesnt need to be the same as
3333
in the original declaration.
3434

3535
Finally, because fields have names, we can access the field through dot

0 commit comments

Comments
 (0)