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

EnumString documentation lacking example #88

Closed
bestia-dev opened this issue Mar 19, 2020 · 1 comment
Closed

EnumString documentation lacking example #88

bestia-dev opened this issue Mar 19, 2020 · 1 comment

Comments

@bestia-dev
Copy link

In the documentation and Wiki for EnumString , there is
//The generated code will look like:
but there is no actual code example how to use it.

Something like this:

use std::str::FromStr;  
let color_str="Red";  
let color_variant = Color ::from_str(color_str).unwrap();
assert!(Color:Red, color_variant);

Why is the documentation/examples using the old syntax:

extern crate strum;  
#[macro_use] extern crate strum_macros;

instead of the new:

use strum;  
use strum_macros
@Peternator7
Copy link
Owner

Good points. I've updated the wiki page with your comments. Thanks!

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

No branches or pull requests

2 participants