aboutsummaryrefslogtreecommitdiff
path: root/crates/rust-analyzer/src/cargo_target_spec.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-01-06 10:54:28 +0000
committerAleksey Kladov <[email protected]>2021-01-06 12:39:28 +0000
commitf7a15b5cd1df58e46066bbd27c90cb1ad7f9c316 (patch)
treedf2caa99c4558b9f2550420896ec9998566e1d5d /crates/rust-analyzer/src/cargo_target_spec.rs
parentc3104466596e85d7fa43b8e3ac015bcabd08fcce (diff)
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
Diffstat (limited to 'crates/rust-analyzer/src/cargo_target_spec.rs')
-rw-r--r--crates/rust-analyzer/src/cargo_target_spec.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/rust-analyzer/src/cargo_target_spec.rs b/crates/rust-analyzer/src/cargo_target_spec.rs
index 8a8b4a32c..5af0802a2 100644
--- a/crates/rust-analyzer/src/cargo_target_spec.rs
+++ b/crates/rust-analyzer/src/cargo_target_spec.rs
@@ -84,14 +84,15 @@ impl CargoTargetSpec {
84 } 84 }
85 } 85 }
86 86
87 if snap.config.cargo.all_features { 87 let cargo_config = snap.config.cargo();
88 if cargo_config.all_features {
88 args.push("--all-features".to_string()); 89 args.push("--all-features".to_string());
89 } else { 90 } else {
90 let mut features = Vec::new(); 91 let mut features = Vec::new();
91 if let Some(cfg) = cfg.as_ref() { 92 if let Some(cfg) = cfg.as_ref() {
92 required_features(cfg, &mut features); 93 required_features(cfg, &mut features);
93 } 94 }
94 for feature in &snap.config.cargo.features { 95 for feature in cargo_config.features {
95 features.push(feature.clone()); 96 features.push(feature.clone());
96 } 97 }
97 features.dedup(); 98 features.dedup();