Skip to content

Commit

Permalink
Update attribute docs for strum_discriminants
Browse files Browse the repository at this point in the history
Currently the README does not mention that extra attributes may be
passed to `#[strum_discriminants()]` and that these will be added as
attributes on the generated enum.  This is a cool feature, we should
document it.
  • Loading branch information
tcharding authored and Peternator7 committed Aug 16, 2019
1 parent 00397fe commit efed585
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@ fn main() {
}
```

When using `#[strum_discriminants()], the derive parameter may be followed by
additional attributes and these will be expanded as attributes on the generated
enum e.g. `#[strum_discriminants(name(SomeOtherName), derive(Serialize), serde(rename_all = "SCREAMING_SNAKE_CASE"))]`

The derived enum also has the following trait implementations:

* `impl From<MyEnum> for MyEnumDiscriminants`
Expand Down

0 comments on commit efed585

Please sign in to comment.