diff --git a/Cargo.toml b/Cargo.toml index af78bb4..67bf00a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,8 @@ serde_bytes = { version = "0.11.9", default-features = false, features = ["alloc serde-transcode = "1.1.1" [features] -default = ["std"] +default = ["codec", "std"] std = ["cbor4ii/use_std", "ipld-core/std", "serde/std", "serde_bytes/std"] +codec = ["ipld-core/codec"] # Prevent deserializing CIDs as bytes as much as possible. no-cid-as-bytes = [] diff --git a/src/lib.rs b/src/lib.rs index 6681a91..32eb251 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -117,7 +117,7 @@ extern crate alloc; mod cbor4ii_nonpub; // The `Codec` implementation is only available if the `no-cid-as-bytes` feature is disabled, due // to the links being extracted with a Serde based approach. -#[cfg(all(feature = "std", not(feature = "no-cid-as-bytes")))] +#[cfg(all(feature = "std", not(feature = "no-cid-as-bytes"), feature = "codec"))] pub mod codec; pub mod de; pub mod error;