book
book copied to clipboard
Clarifying @ bindings (suggestion rather than bug)
In ch18-03-pattern-syntax, discussion of listing 18-29 (@ Bindings), It might be useful to say whether the structure shorthand
Message::Hello { id } => {}
is in fact equivalent to
Message::Hello { id: id @}
I'm not sure if the latter syntax (explicit binding without specifying value/range) is accepted, but conceptually I think that's what the shorthand maps to ... and pointing that similarity to something already seen might help nail down the reader's understanding of @ binding semantics.