Skip to content

Glossary: Rust Basics

Field init shorthand

When a variable has the same name as a struct field, you can write it once, like `price_cents,` instead of `price_cents: price_cents`.

Where the book teaches it

Related terms

FieldStruct