Generate an enum with one variant for each unit, use that for iteration.#215
Conversation
|
This indeed much simpler than doing tricks with |
|
I think I've fixed everything. |
iliekturtles
left a comment
There was a problem hiding this comment.
Couple more minor changes. I think the code looks good so far but I have only reviewed through github. I want to do one more review, hopefully this weekend, with the compiler then I think we'll be able to merge.
- Remove inline on units() - Move and rename unit test.
|
I haven't forgotten about this, I just didn't finish my review this weekend. I like using |
|
Merged! Thanks so much for the PR and sorry for the delays. My quest to use the user-provided documentation on the |
This extends the
quantity!macro to generate a non-exhaustive enum with one variant per unit. A static slice of the different potential values of this enum is also generated, which is exposed publicly through aunits()function, which returns an iterator. This can be used to iterate over the different units.