2 ms·
How is it different from a one-field struct in Swift, other than that Swift makes you name the field while Rust allows it to have the name “.0”?
by slavapestov 4y ago
How is it different from a one-field struct in Swift, other than that Swift makes you name the field while Rust allows it to have the name “.0”?
- wwalexander 4y agoPractically, there’s little difference. But as they say, naming things is one of the two hard problems in computer science and I’d rather avoid it wherever possible when the name inevitably doesn’t add any meaning, and arguably obscures it. I could just use rawValue as the field name every time, but foo.rawValue is a lot less readable, IMO, than foo.0