From aa503aba9ef7175ad6842abaa3cf4e1584136fcb Mon Sep 17 00:00:00 2001 From: ian Date: Wed, 19 Dec 2018 07:29:39 +0800 Subject: [PATCH] Add lib1 in top Cargo.toml Now, like a magic, `lib1` will use `feature1` in any environment: ``` cargo test cargo test --all cargo build && target/debug/foo cargo build --all && target/debug/foo cargo build --release && target/release/foo cargo build --release --all && target/release/foo ``` --- Cargo.lock | 1 + Cargo.toml | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 72c812d..c5dcd8c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,7 @@ name = "foo" version = "0.1.0" dependencies = [ + "lib1 0.1.0", "lib2 0.1.0", ] diff --git a/Cargo.toml b/Cargo.toml index af6a4a8..54d67fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,10 +5,15 @@ authors = ["quake wang "] edition = "2018" [dependencies] +lib1 = { path = "lib1" } lib2 = { path = "lib2"} +[dev-dependencies] +lib1 = { path = "lib1", features = ["feature1"] } + [workspace] members = [ "lib1", "lib2" ] +