mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Add optional flag to manifest for dependencies
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
This commit is contained in:
parent
12d7818192
commit
504c4b2fbb
@ -1564,6 +1564,9 @@ impl Package {
|
|||||||
"#,
|
"#,
|
||||||
target, kind, dep.name, dep.vers
|
target, kind, dep.name, dep.vers
|
||||||
));
|
));
|
||||||
|
if dep.optional {
|
||||||
|
manifest.push_str("optional = true\n");
|
||||||
|
}
|
||||||
if let Some(artifact) = &dep.artifact {
|
if let Some(artifact) = &dep.artifact {
|
||||||
manifest.push_str(&format!("artifact = \"{}\"\n", artifact));
|
manifest.push_str(&format!("artifact = \"{}\"\n", artifact));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user