How to best iterate over all values of an enum?
⚓ Rust 📅 2025-06-20 👤 surdeus 👁️ 14Hello,
I want to iterate over all values of an enum, some values hold data types, others do not.
I did some reading and the strum crate was mentioned. Is there another way to do this?
Ideally this will not need to be changed if more enums are added.
Thanks!
enum OpCode
{ OpReturn, OpConstant(i8)} // more
8 posts - 4 participants
🏷️ rust_feed