Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new derive: AsVariant #415

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

crazymerlyn
Copy link

Resolves #358

Synopsis

A new derive for generating as_foo, as_bar methods for an enum with fields foo and bar.

Solution

Similar to TryUnwrap but generates functions returning an Option instead of a Result.

Checklist

  • Documentation is updated (if required)
  • Tests are added/updated (if required)
  • CHANGELOG entry is added (if required)

Similar to TryUnwrap but generates functions returning an Option instead
of a Result.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AsVariant for enum
1 participant