Skip to content

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

Open
@TimLuq

Description

@TimLuq

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions