From 3094dfd2c07d00e4ba89a04c96c8270287be4794 Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Wed, 24 Feb 2021 12:30:49 -0500 Subject: [PATCH] select nom features --- Cargo.toml | 2 +- src/lib.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 2a66f00..fea07b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -nom = "6" +nom = { version = "6", default_features = false, features = ["std"] } bstr = "0.2.15" [dependencies.serde_crate] diff --git a/src/lib.rs b/src/lib.rs index 71b65d2..d27f159 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,9 @@ #![forbid(unsafe_code)] +// Cargo.toml cannot have self-referential dependencies, so you can't just +// specify the actual serde crate when you define a feature called serde. We +// instead call the serde crate as serde_crate and then rename the crate to +// serde, to get around this in an intuitive manner. #[cfg(feature = "serde")] extern crate serde_crate as serde;