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

Unable to compile the combination of no_std and the serde feature #57

Open
TimLuq opened this issue Jan 15, 2023 · 0 comments · May be fixed by #60
Open

Unable to compile the combination of no_std and the serde feature #57

TimLuq opened this issue Jan 15, 2023 · 0 comments · May be fixed by #60

Comments

@TimLuq
Copy link

TimLuq commented Jan 15, 2023

Since the serde.rs file expects String to be made available by the prelude the compilation fails if serde is activated without std.

> cargo build
   Compiling ulid v1.0.0
error[E0433]: failed to resolve: use of undeclared type `String`
  --> ulid-1.0.0/src/serde.rs:28:32
   |
28 |         let deserialized_str = String::deserialize(deserializer)?;
   |                                ^^^^^^ use of undeclared type `String`

I propose that when the std feature is used it will depend on serde?/std and by default the optional serde dependency has { default-features = false, features = ["alloc", "derive"] }. I'll make a PR for this sometimes this coming week if no one else beats me to it.

@TimLuq TimLuq linked a pull request Jan 23, 2023 that will close this issue
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 a pull request may close this issue.

1 participant