From d85c937ac6eddc9c3161fe9cb084e61b5139098a Mon Sep 17 00:00:00 2001 From: Jon Doron Date: Tue, 14 Jan 2025 16:11:17 +0200 Subject: [PATCH 1/2] Dont use serde default features Signed-off-by: Jon Doron --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index d51ba3c..62eb66e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ serde = ["dep:serde"] [dependencies] bitstring = { version = "0.2.0", optional = true, features = ["net"] } -serde = { version = "1.0.27", optional = true } +serde = { version = "1.0.27", default-features = false, features = ["alloc"], optional = true } [dev-dependencies] serde_test = "1.0.27" From 31fe03872239dea82f1e76872f0b341f19b26f7a Mon Sep 17 00:00:00 2001 From: Jon Doron Date: Wed, 15 Jan 2025 10:24:07 +0200 Subject: [PATCH 2/2] Fix support for no_std * Serde can be used with "alloc" feature only. * Error can be implemented now with Error Signed-off-by: Jon Doron --- Cargo.toml | 2 +- src/errors.rs | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 62eb66e..7354d2c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ serde = ["dep:serde"] [dependencies] bitstring = { version = "0.2.0", optional = true, features = ["net"] } -serde = { version = "1.0.27", default-features = false, features = ["alloc"], optional = true } +serde = { version = "1.0.217", default-features = false, features = ["alloc"], optional = true } [dev-dependencies] serde_test = "1.0.27" diff --git a/src/errors.rs b/src/errors.rs index efa6086..c1d3743 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -81,7 +81,6 @@ impl fmt::Display for NetworkParseError { } } -#[cfg(feature = "std")] impl Error for NetworkParseError { fn description(&self) -> &str { "network parse error" @@ -137,7 +136,6 @@ impl fmt::Display for InetTupleError { } } -#[cfg(feature = "std")] impl Error for InetTupleError { fn description(&self) -> &str { "inet tuple error"