Skip to content

Chapter 20.2: "type" instead of "trait" #4539

@NeatNit

Description

@NeatNit
  • I have searched open and closed issues and pull requests for duplicates, using these search terms:
    • To extend a type without breaking existing code
    • 20.2
    • type trait
  • I have checked the latest main branch to see if this has already been fixed, in this file:
    • /src/ch20-02-advanced-traits.md

URL to the section(s) of the book with this problem: https://doc.rust-lang.org/book/ch20-02-advanced-traits.html#listing-20-16

Description of the problem:
I think there's a mistake in this part:

You’ll use default type parameters in two main ways:

  1. To extend a type without breaking existing code
  2. To allow customization in specific cases most users won’t need

1 should be: "To extend a trait without breaking existing code"

You’ll use default type parameters in two main ways:
1. To extend a type without breaking existing code
2. To allow customization in specific cases most users won’t need

P.S. I have come across a few other errors that have already been fixed in the main branch, which is great of course, but when will the online book be updated to match?

And of course, it goes without saying, thank you to everyone who wrote the book. It's fantastic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions