soc.me · Sep 20, 2023
Language Design: Rust's Struct Initializer Syntax Was a Mistake
0Sign in to vote or save
This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.
Rust has distinct syntactic facilities for … invoking functions initializing structs and enums initializing tupled structs and enums … that provide different affordances and features: method arguments are positional and cannot be named initializer arguments are named, and what looks like positional arguments is a special shorthand notation initializer arguments for tuple structs and enums look…
Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.