The idea here is to make the conversion between Row (or &[DataType]) and an
index for the state map reusable, namely for other State impls.
It just so happens that that also allows me to apply some do-not-repeat-yourself
principles to the state impls using small macro_rules.
I did this change in preparation of implementing a custom State. I don't necessarily mean to suggest that this version is better, and should be merged` but I thought I'd inform you about the possibility.
The code isn't actually shorter, which I think is a bit unfortunate, but perhaps more readable.
The idea here is to make the conversion between
Row
(or&[DataType]
) and an index for the state map reusable, namely for otherState
impls. It just so happens that that also allows me to apply some do-not-repeat-yourself principles to the state impls using smallmacro_rules
.I did this change in preparation of implementing a custom
State
. I don't necessarily mean to suggest that this version is better, and should be merged` but I thought I'd inform you about the possibility.The code isn't actually shorter, which I think is a bit unfortunate, but perhaps more readable.