Description
Hellu. First of all, thanks for the crate. It's freaking awesome.
So I was doing some exercises at exercism.org, as practice, and there was an exercise that used this crate. I realized that most of the functions it requires don't (or almost don't) need any runtime information to be computed:
value_to_color_string
can be solved with aconst Hashmap<u32, &str>
colors
is basically aconst Vec<ResistorColor>
So long story short, I realized that I couldn't make these things const
because, among other things, enum-iterator
itself's methods aren't const. So I came and tried to add const
ness for the methods, thinking of submitting that as a PR, but I ran into a wall in the language that took me to rust-lang/rust#101900.
I think the methods in the crate can't currently be made const
(since they are Trait methods after all?), but I could be wrong.
Anywho. I'm 99% sure you've already delved into this, and that it's in some todo-list of your own. But perhaps it wasn't, and this helps somewhat.
Also this allows me to say thanks for the crate. It's a really cool crate. Thanks :D