Skip to content

Commit

Permalink
Fix plural and incorrect phrase. Fixes #3359.
Browse files Browse the repository at this point in the history
  • Loading branch information
carols10cents committed Oct 27, 2022
1 parent 8612c4a commit d339373
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/ch05-03-method-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ the instance’s `width` field is greater than `0` and `false` if the value is
method `width`. When we don’t 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 type’s 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 type’s 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 -->.

> ### Where’s the `->` Operator?
>
Expand Down

0 comments on commit d339373

Please sign in to comment.