3 ms·
I would like this plus the ability to specify per-field defaults on structs like struct Foo { bar: String, // No default baz: Option<u3
by nicoburns 5y ago
I would like this plus the ability to specify per-field defaults on structs like
struct Foo {
bar: String, // No default
baz: Option<u32> = None,
}
I think this would give us 90% of what I would want from first-class named parameters.
- estebank 5y agoI'm looking for the time to write exactly that RFC. The parser, for what is worth, already parses that syntax for error recovery :) If you're interested, this is the last public conversation I had about these: https://internals.rust-lang.org/t/pre-pre-rfc-syntactic-sugar-for-default-default/13234 https://internals.rust-lang.org/t/pre-pre-rfc-syntactic-suga...