Fix plural and incorrect phrase. Fixes #3359.

This commit is contained in:
Carol (Nichols || Goulding) 2022-10-27 15:15:19 -04:00 committed by Carol (Nichols || Goulding)
parent 8612c4a580
commit d339373a83
1 changed files with 8 additions and 8 deletions

View File

@ -78,14 +78,14 @@ the instances `width` field is greater than `0` and `false` if the value is
method `width`. When we dont use parentheses, Rust knows we mean the field
`width`.
Often, but not always, when we give methods with the same name as a field we
want it to only return the value in the field and do nothing else. Methods like
this are called *getters*, and Rust does not implement them automatically for
struct fields as some other languages do. Getters are useful because you can
make the field private but the method public, and thus enable read-only access
to that field as part of the types public API. We will discuss what public and
private are and how to designate a field or method as public or private in
[Chapter 7][public]<!-- ignore -->.
Often, but not always, when we give a method the same name as a field we want
it to only return the value in the field and do nothing else. Methods like this
are called *getters*, and Rust does not implement them automatically for struct
fields as some other languages do. Getters are useful because you can make the
field private but the method public, and thus enable read-only access to that
field as part of the types public API. We will discuss what public and private
are and how to designate a field or method as public or private in [Chapter
7][public]<!-- ignore -->.
> ### Wheres the `->` Operator?
>