More maintainable config

Rather than eagerly converting JSON, we losslessly keep it as is, and
change the shape of user-submitted data at the last moment.

This also allows us to remove a bunch of wrong Defaults
This commit is contained in:
Aleksey Kladov
2021-01-06 13:54:28 +03:00
parent c310446659
commit f7a15b5cd1
16 changed files with 422 additions and 442 deletions

View File

@@ -84,14 +84,15 @@ impl CargoTargetSpec {
}
}
if snap.config.cargo.all_features {
let cargo_config = snap.config.cargo();
if cargo_config.all_features {
args.push("--all-features".to_string());
} else {
let mut features = Vec::new();
if let Some(cfg) = cfg.as_ref() {
required_features(cfg, &mut features);
}
for feature in &snap.config.cargo.features {
for feature in cargo_config.features {
features.push(feature.clone());
}
features.dedup();