How to use strum crate in Rust enum derive macros

Use the strum crate and strum_macros to automatically generate Display, Iter, and other helper methods for Rust enums.

Add the strum crate to your Cargo.toml and use the #[derive] macro with specific traits like Display or EnumIter on your enum to generate helper methods.

[dependencies]
strum = "0.26"
strum_macros = "0.26"
use strum_macros::{Display, EnumIter};

#[derive(Display, EnumIter)]
enum Color {
    Red,
    Blue,
}

fn main() {
    println!("{:?}", Color::Red); // Prints "Red"
    for color in Color::iter() {
        println!("{:?}", color);
    }
}