Skip to content

Are annotations explained? #1333

Open
Open
@jeremyfrench

Description

@jeremyfrench

Hi I've been reading the 2nd edition but this issue also seems to apply to the 2018 one.

The book has in general done a very good job of explaining things as you read, or telling you that something will be explained later.

However while reading about derived traits (in section 5.2) I read this

Rust does include functionality to print out debugging information, but we have to explicitly opt-in to make that functionality available for our struct. To do that, we add the annotation #[derive(Debug)] just before the struct definition, as shown in Listing 5-12:

This shows the code to add, but it does not seem to explain what annotations are and how they work. It is perhaps the fist instance in this book where I have been left wondering about how something works.

I was expecting something like 'we talk about annotations in more detail in chapter X', or conversely having them mentioned after comments in the common language constructs section.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions