An open API service indexing awesome lists of open source software.

https://github.com/maxblee/derive_custom_enum_traits


https://github.com/maxblee/derive_custom_enum_traits

Last synced: 12 months ago
JSON representation

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`.