top | item 40335891

(no title)

pflanze | 1 year ago

If we're talking about constructing structs, like in `Foo { bar, baz: 123 }` (with the `bar` style shortcut in it), I have used that kind of syntax 10 times in 16 KLOC of Rust. Not a lot, but it does happen, and I found it kinda neat when LSP integration suggested its use.

I've probably used it more for pattern matching (`let Foo { bar, baz } = ...`), but haven't measured the number of instances of that idiom.

discuss

order

leononame|1 year ago

You're right constructing struts in Rust works with that pattern, so I'll take the Rust bit back.