Peternator7 / strum

A small rust library for adding custom derives to enums
https://crates.io/crates/strum
MIT License
1.8k stars 151 forks source link

[Feature] Macro to Implement PartialEq<str> #303

Closed wyatt-herkamp closed 1 year ago

wyatt-herkamp commented 1 year ago

So I made a macro called CompareStr

Basically it implements PartialEq for the Enum.

#[derive(Debug, Clone, PartialEq, Eq, CompareToStr)]
pub enum OtherTypes {
    #[compare_str(equals["uuid::Uuid", "Uuid"])]
    UUID {
        format: UUIDFormat,
        version: UUIDVersion,
    },
    #[compare_str(equals["PathBuf", "Path"])]
    FilePath,
}

I would like to create a Pull Request to implement this concept into Strum.

So I was wanting to ask if this is a feature people would like to see in Strum. I would add support for PHF if I made a PR.

Peternator7 commented 1 year ago

While this is cool, I probably can't accept a PR for it at the moment. There's a handful of larger features that are in-progress, and as the only maintainer, the complexity of managing strum as new features get added continues to increase. It's a neat feature for sure, but I think it's somewhat niche and I probably can't support it properly at this point. Thanks for reaching out however!