From 504c4b2fbb1bd652d6ac93a947079d7ecb95b955 Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Sun, 19 Nov 2023 21:37:29 +0800 Subject: [PATCH] Add optional flag to manifest for dependencies Signed-off-by: hi-rustin --- crates/cargo-test-support/src/registry.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/cargo-test-support/src/registry.rs b/crates/cargo-test-support/src/registry.rs index 9791fef2e..237d59bf0 100644 --- a/crates/cargo-test-support/src/registry.rs +++ b/crates/cargo-test-support/src/registry.rs @@ -1564,6 +1564,9 @@ impl Package { "#, target, kind, dep.name, dep.vers )); + if dep.optional { + manifest.push_str("optional = true\n"); + } if let Some(artifact) = &dep.artifact { manifest.push_str(&format!("artifact = \"{}\"\n", artifact)); }