Skip to content

Chapter 6.1 is confusing as it uses the same code snippet four times #4620

@pgoodall

Description

@pgoodall
  • I have searched open and closed issues and pull requests for duplicates, using these search terms:
    • Enum
    • Ch.6.1
    • 6.1
  • I have checked the latest main branch to see if this has already been fixed, in this file:
    • Yes

URL to the section(s) of the book with this problem:
Source: src/ch06-01-defining-an-enum.md
Rendered book: https://doc.rust-lang.org/book/ch06-01-defining-an-enum.html

Description of the problem:
The code snippets in Chapter 6.1 on Enums are confusing because they appear as the exact same code repeated four times. The descriptive text below is talking about some variants of the code, but it isn't clear what part of the code the text is referring to.

Looking at the source, it appears that each of those four snippets should be rendering just a section of the code, but the anchors don't appear to be working. Therefore, the whole of main.rs is shown four times.

Suggested fix:
I haven't looked into how you render the html from md, but I'm happy to do so. I just wanted to get the issue filed while I was reading that chapter.

Image

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