100% with one caveat: accessing the fields of a closure is not technically a stable part of the language’s API, so if you need to access the a
field then you should use the explicit struct approach since that is guaranteed to work no matter what changes are made to the compiler. If you don’t need to access the a
field then it’s just a matter of preference.
11 Likes