I wrote a little derive macro that generates is_* methods for each enum variant, and I wonder if strum would be a good home for it. If so, I'll open a PR.
Example:
#[derive(Is)]
enum Foo {
Bar {},
Biz
}
The Is derive will add is_bar() and is_biz() methods, similar to Option::is_some(), Option::is_none(), Result::is_ok(), etc.
I wrote a little derive macro that generates
is_*
methods for each enum variant, and I wonder if strum would be a good home for it. If so, I'll open a PR.Example:
The
Is
derive will addis_bar()
andis_biz()
methods, similar toOption::is_some()
,Option::is_none()
,Result::is_ok()
, etc.I think that:
is a lot cleaner then:
Thoughts?