Skip to content

Example in 17.3 is contradictory #2159

Closed
rust-lang/rust
#93532
@malaire

Description

@malaire

Example in chapter 17.3 is contradictory in whether text should be allowed to be added only in Draft state or in any state.

After listing 17-11 text says:

... we want to allow text to be added to the blog post while it’s in the draft state ...

Later after listing 17-13 text says:

... This behavior doesn’t depend on the state the post is in, so it’s not part of the state pattern. The add_text method doesn’t interact with the state field at all, but it is part of the behavior we want to support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions