cognitive-engineering-lab / rust-book

The Rust Programming Language: Experimental Edition
https://rust-book.cs.brown.edu
Other
506 stars 82 forks source link

Bad phrasing #65

Closed seishun closed 1 year ago

seishun commented 1 year ago

URL to the section(s) of the book with this problem: https://rust-book.cs.brown.edu/ch17-03-oo-design-patterns.html#trade-offs-of-the-state-pattern

Description of the problem:

If we were to create an alternative implementation that didn’t use the state pattern, we might instead use match expressions in the methods on Post or even in the main code that checks the state of the post and changes behavior in those places.

The only valid subject for "checks" and "changes" is "the main code", but then it's unclear how we would use match expressions in the methods on Post and what "those places" refers to.

Suggested fix:

Change to "check" and "change"?

willcrichton commented 1 year ago

Fixed this in 780b7c9372a3581d08f4eeed814685b3dc753c2a.