Skip to content

no_std support is broken with serde feature enabled #112

@aleasims

Description

@aleasims

First, thanks for the crate, it was pretty useful for me.

ascii depends on serde with enabled default features (including serde/std). Which means that when building with --no-default-features -F serde, the std is actually required.

Looks like it can be fixed by disabling serde default features. Here is the Cargo.toml patch:

diff --git a/Cargo.toml b/Cargo.toml
index 8ec25de..4aaeea3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,12 +9,12 @@ repository = "https://github.com/tomprogrammer/rust-ascii"
 version = "1.1.0"

 [dependencies]
-serde = { version = "1.0.25", optional = true }
+serde = { version = "1.0.25", optional = true, default-features = false }
 serde_test = { version = "1.0", optional = true }

 [features]
 default = ["std"]
-std = ["alloc"]
+std = ["alloc", "serde?/std"]
 alloc = []

 [[test]]

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