use std::fmt::Debug; // <--- add this line, for example some people might wish to custom implement the Debug trait
#[derive(Eq, PartialEq, EnumString, Display, EnumCount, EnumDiscriminants, EnumIs)]
pub enum Color {
/// Docs on red
#[strum(to_string = "RedRed")]
Red,
#[strum(serialize = "b", to_string = "blue")]
Blue { hue: usize },
#[strum(serialize = "y", serialize = "yellow")]
Yellow,
#[strum(disabled)]
Green(String),
}
impl Debug for Color {
...
}
This will cause the following error.
error[E0034]: multiple applicable items in scope
--> strum_tests/src/lib.rs:5:44
|
5 | #[derive(Debug, Eq, PartialEq, EnumString, Display, EnumCount, EnumDiscriminants, EnumIs)]
| ^^^^^^^ multiple `fmt` found
|
= note: candidate #1 is defined in an impl of the trait `Debug` for the type `str`
= note: candidate #2 is defined in an impl of the trait `std::fmt::Display` for the type `str`
= note: this error originates in the derive macro `Display` (in Nightly builds, run with -Z macro-backtrace for more info)
This will cause the following error.