Closed rnestler closed 3 years ago
I think that API could be improved a bit, I'm not too fond of the mutable integer reference...
Well which API? The internal one of MeasurementValue
? Or the public one of MeasurementMessage
?
Maybe an Encoder could be created that tracks the bit index internally by using the associated constant of the MeasurementValue trait?
That sounds overly complicated to me to track a single value, but if you propose something concrete I may change my opinion :slightly_smiling_face:
The internal API.
Here are three commits that would (in my view) improve the API. If you agree, you can apply them with git am <filename>
.
https://gist.github.com/dbrgn/c576858d0138fd8ba406cf92937324c8
See #79