mirror of
https://github.com/danog/strum.git
synced 2024-11-26 20:14:40 +01:00
Update README.md
This commit is contained in:
parent
460700124a
commit
9fa967505c
@ -41,7 +41,7 @@ Strum has implemented the following macros:
|
||||
|
||||
Here is an example of the code generated by deriving `EnumString`.
|
||||
|
||||
```
|
||||
```rust
|
||||
extern crate strum;
|
||||
#[macro_use] extern crate strum_macros;
|
||||
#[derive(EnumString)]
|
||||
@ -186,7 +186,7 @@ applied to a variant by adding #[strum(parameter="value")] to the variant.
|
||||
The generated code will now return the variant with the input string captured as shown below
|
||||
instead of failing.
|
||||
|
||||
```ignore
|
||||
```rust,ignore
|
||||
// Replaces this:
|
||||
_ => Err(strum::ParseError::VariantNotFound)
|
||||
// With this in generated code:
|
||||
|
Loading…
Reference in New Issue
Block a user