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

Consider adding a 'static equivalent of AsRef<str> #23

Closed
shepmaster opened this issue May 14, 2018 · 1 comment
Closed

Consider adding a 'static equivalent of AsRef<str> #23

shepmaster opened this issue May 14, 2018 · 1 comment

Comments

@shepmaster
Copy link

Would be useful for answering this Stack Overflow question.

lo48576 added a commit to lo48576/strum that referenced this issue May 23, 2018
lo48576 added a commit to lo48576/strum that referenced this issue May 23, 2018
`#[derive(AsStaticStr)]` will implement `AsStaticRef<str>`, and it
enables us to get `&'static str` by `AsStaticRef::<str>::as_static()`.

This will solve Peternator7#23.
lo48576 added a commit to lo48576/strum that referenced this issue May 23, 2018
`#[derive(AsRefStr)]` will implement `AsStaticRef<str>`, and it
enables us to get `&'static str` by `AsStaticRef::<str>::as_static()`.

This will solve Peternator7#23.
lo48576 added a commit to lo48576/strum that referenced this issue May 23, 2018
`#[derive(AsRefStr)]` will implement `AsStaticRef<str>`, and it
enables us to get `&'static str` by `AsStaticRef::<str>::as_static()`.

This will solve Peternator7#23.
Peternator7 pushed a commit that referenced this issue May 26, 2018
`#[derive(AsRefStr)]` will implement `AsStaticRef<str>`, and it
enables us to get `&'static str` by `AsStaticRef::<str>::as_static()`.

This will solve #23.
@Peternator7
Copy link
Owner

Added AsStaticStr custom derive in 0.10.0 that implments for strum::AsStaticRef<str> which has a method as_static() that will work in the future 😊

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