Skip to content

Commit dbf6ede

Browse files
committed
Minor text edit
1 parent fe1dd37 commit dbf6ede

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

13_structs.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A struct is a fairly straightforward type.
44
It's similar to classes in OOP languages, but there's no concept of inheritance or polymorphism here.
55
It simply allows you to group together related pieces of data - which can all be of different types - into a single name.
66
At a high level, we first define the struct by providing it's name, the names of the different fields and their associated types.
7-
We then create an instance of the struct by specifying the the values for each field.
7+
We then create an instance of the struct by specifying the values for each field.
88
We can also add methods to a struct by defining functions within an `impl` block.
99

1010
Let's create an input struct to group together our related input fields.
@@ -41,7 +41,8 @@ And all we have to do is create an instance of it in our `main` function:
4141
...
4242
```
4343

44-
Pretty simple right? One neat modification we can make here is remove the key/value pair and just put a comma separated list of field names.
44+
Pretty simple right?
45+
One neat modification we can make here is remove the key/value pair and just put a comma separated list of field names.
4546
We can do this anytime the field names match the variable names:
4647

4748
```rust

0 commit comments

Comments
 (0)