witty-crayon-22786
05/21/2018, 6:58 PMaverage-vr-56795
05/21/2018, 7:01 PMwitty-crayon-22786
05/21/2018, 7:02 PMwitty-crayon-22786
05/21/2018, 7:02 PMwitty-crayon-22786
05/21/2018, 7:03 PMwitty-crayon-22786
05/21/2018, 7:03 PMaloof-angle-91616
05/21/2018, 7:44 PM<object>.<field>) — i feel like it also encourages more precise clone()ing and helps to understand where you can split up fields of a struct e.g. into different structs, because if you find yourself using , .. } too often you may realize you can move some of those fields elsewherealoof-angle-91616
05/21/2018, 7:45 PMwitty-crayon-22786
05/21/2018, 7:48 PMwitty-crayon-22786
05/21/2018, 7:50 PMmatch and if let, but less fun in situations without some scope for the local variablesaloof-angle-91616
05/21/2018, 7:54 PMaverage-vr-56795
05/21/2018, 8:24 PMwitty-crayon-22786
05/21/2018, 8:24 PMfs_pool example is a good onewitty-crayon-22786
05/21/2018, 8:25 PMwitty-crayon-22786
05/21/2018, 8:25 PMaverage-vr-56795
05/21/2018, 8:26 PMwitty-crayon-22786
05/21/2018, 8:27 PMaverage-vr-56795
05/21/2018, 8:28 PMaverage-vr-56795
05/21/2018, 8:28 PMwitty-crayon-22786
05/21/2018, 8:31 PMwitty-crayon-22786
05/21/2018, 8:31 PMwitty-crayon-22786
05/21/2018, 8:32 PMwitty-crayon-22786
05/21/2018, 8:33 PMwitty-crayon-22786
05/21/2018, 8:33 PMaloof-angle-91616
05/21/2018, 8:50 PMI find "because a struct's field has this name" is a bad reason for a variable name in another scope...i think i understand/agree with the idea behind this, but my point of view was that the causality would flow the other way, that the variable would be named that way because the struct field was named that way -- this encourages struct field naming which is appropriate to use in destructuring let statements. this is also coming from my tendency to make pretty granular structs/enums so that there are more distinct names available. i agree that i don't see
let MyStruct { field_name , ... } = arg; in the engine source much, and i can see that obviously if let and match introducing a new scope makes it easier to use field name destructing. (let should introduce a new scope too, imo, but it doesn't)aloof-angle-91616
05/21/2018, 8:52 PMin general I want things in the function doing the constructing to be a qualified with something which represents the thing they're constructing, but that qualifier is redundant within the struct itself...i totally 100% agree, and using more granular types provides that qualification while allowing for destructuring with the field name shorthand, for example, which is where i was coming from
aloof-angle-91616
05/21/2018, 8:52 PMaloof-angle-91616
05/21/2018, 8:54 PMlet MyStruct { field, .. } = arg; in our rust code, or if that's really less clear (i find it easier to refactor than using the dot syntax personally)