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

Use core::result instead of std::result in order to make it work in a… #189

Merged
merged 1 commit into from Oct 26, 2021

Conversation

daym
Copy link
Contributor

@daym daym commented Oct 25, 2021

… no_std environment.

This pull request would avoid using std::result, instead favoring core::result, in order to make FromStr work in a no_std environment.

@Peternator7
Copy link
Owner

LGTM 👍 Thanks for the improvement

@Peternator7 Peternator7 merged commit 1a703a4 into Peternator7:master Oct 26, 2021
@Peternator7
Copy link
Owner

Released in version 0.23! Thanks for the PR. https://crates.io/crates/strum

@daym
Copy link
Contributor Author

daym commented Nov 18, 2021

Thank you for the release.

Unfortunately, it does not work since there are now more references to std::convert and so on in the generated code (i.e. inside quote!)--in the same file at the bottom (the ones in try_from_str were added only after my change).

I recommend adding a simple integration test for the no_std environment.

error[E0433]: failed to resolve: could not find `std` in the list of imported crates
   --> src/ondisk.rs:147:56
    |
147 | #[derive(Debug, PartialEq, FromPrimitive, Clone, Copy, EnumString)]
    |                                                        ^^^^^^^^^^ could not find `std` in the list of imported crates
    |
    = note: this error originates in the derive macro `EnumString` (in Nightly builds, run with -Z macro-backtrace for more info)

@Peternator7
Copy link
Owner

Sorry about that, merged the other PR. Will add integration test when there's time.

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

Successfully merging this pull request may close these issues.

None yet

2 participants