Skip to content

Tuple struct syntax is confusing in chapter 15 #1916

Closed
rust-lang/rust
#93532
@schlamar

Description

@schlamar

The tuple struct is just explained very shortly in textual form without an example accessing the elements (ch05-01-defining-structs). So when I first saw self.0 (in ch15-02-deref) I was very confused.

Plus I couldn't find anything helpful by searching "self.0" in the book. There should be a small example using tuple structs with method, probably in ch05-03-method-syntax.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions