https://github.com/maxblee/derive_custom_enum_traits
https://github.com/maxblee/derive_custom_enum_traits
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/maxblee/derive_custom_enum_traits
- Owner: maxblee
- License: mit
- Created: 2022-03-03T03:22:21.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-03T03:27:35.000Z (over 4 years ago)
- Last Synced: 2023-03-08T20:57:11.422Z (over 3 years ago)
- Language: Rust
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# derive_custom_enum_traits
This is a set of (currently one) derive macros for Rust for dealing with enums. Its current macro, `DeriveIndex`
creates two functions for an enum, `to_index`, which converts an enum variant into its 0-indexed order; and
`from_index` which converts a `usize` into an `Option`.