From 61a5295eb9bda08a159f33c54b02ded356c579a5 Mon Sep 17 00:00:00 2001 From: Yuval Kohavi Date: Tue, 3 Nov 2020 16:02:09 -0500 Subject: [PATCH] wee alloc as feature Signed-off-by: Yuval Kohavi --- Cargo.toml | 5 +++-- src/lib.rs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c7cb3f3b..4ddd3d66 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,9 +11,10 @@ edition = "2018" [dependencies] hashbrown = { version = "0.8", default-features = false, features = ["ahash", "inline-more"] } log = "0.4" +wee_alloc = { version = "0.4", optional = true } -[target.'cfg(target_arch = "wasm32")'.dependencies.wee_alloc] -version = "0.4" +[features] +wee_alloc = ["wee_alloc"] [dev-dependencies] chrono = "0.4" diff --git a/src/lib.rs b/src/lib.rs index 54d3a5b3..af371644 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -16,7 +16,7 @@ pub mod hostcalls; pub mod traits; pub mod types; -#[cfg(target_arch = "wasm32")] +#[cfg(feature = "wee_alloc")] mod allocator; mod dispatcher; mod logger;