Peternator7 / strum

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

Added EnumTryAs #285

Closed MendyBerger closed 1 year ago

MendyBerger commented 1 year ago

Resolves https://github.com/Peternator7/strum/issues/277

Didn't do unwrap, mentioned reasoning in this comment. Let me know if you disagree. https://github.com/Peternator7/strum/issues/277#issuecomment-1625989390

Peternator7 commented 1 year ago

Really good start imo; I think just doing the "try_as" option methods provides the right balance between exposing new functionality via macro and steering users back towards existing concepts such as option.