illicitonion / num_enum

Apache License 2.0
264 stars 34 forks source link

fix: filter catch_all variant in EnumInfo methods #150

Closed duskmoon314 closed 3 months ago

duskmoon314 commented 3 months ago

This commit filters out catch_all variant in the variant_idents and variant_expressions of EnumInfo. This allows the catch_all variant to be in the middle of enum.

A test of catch_all variant in the middle of enum is also added.

Fix #149

duskmoon314 commented 3 months ago

Warning: note: if you need to support cargo 1.38 or earlier, you can symlink config to config.toml

It seems config should be renamed to config.toml. And this caused trybuild to panic.

duskmoon314 commented 3 months ago

It's weird that I haven't found .config or lines that create .config in CI. I wonder whether this is caused by the archived actions-rs/cargo.

Since actions-rs/cargo is archived, I think it could be replaced by run: cargo test <..args>.

May I ask what's your opinion? @illicitonion

illicitonion commented 3 months ago

Thanks for looking at the .config stuff - I think this is a relic created by older versions of trybuild, and that to work around it we'll probably need to bump MSRV. I'll put this together as a separate PR shortly!

illicitonion commented 3 months ago

Published in 0.7.3 - thanks again so much!