aboutsummaryrefslogtreecommitdiff
path: root/crates/project_model/src
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/project_model/src
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/project_model/src')
-rw-r--r--crates/project_model/src/project_json.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/project_model/src/project_json.rs b/crates/project_model/src/project_json.rs
index af884eb84..41a2ac03e 100644
--- a/crates/project_model/src/project_json.rs
+++ b/crates/project_model/src/project_json.rs
@@ -110,13 +110,13 @@ impl ProjectJson {
110 } 110 }
111} 111}
112 112
113#[derive(Deserialize)] 113#[derive(Deserialize, Debug, Clone)]
114pub struct ProjectJsonData { 114pub struct ProjectJsonData {
115 sysroot_src: Option<PathBuf>, 115 sysroot_src: Option<PathBuf>,
116 crates: Vec<CrateData>, 116 crates: Vec<CrateData>,
117} 117}
118 118
119#[derive(Deserialize)] 119#[derive(Deserialize, Debug, Clone)]
120struct CrateData { 120struct CrateData {
121 display_name: Option<String>, 121 display_name: Option<String>,
122 root_module: PathBuf, 122 root_module: PathBuf,
@@ -132,7 +132,7 @@ struct CrateData {
132 source: Option<CrateSource>, 132 source: Option<CrateSource>,
133} 133}
134 134
135#[derive(Deserialize)] 135#[derive(Deserialize, Debug, Clone)]
136#[serde(rename = "edition")] 136#[serde(rename = "edition")]
137enum EditionData { 137enum EditionData {
138 #[serde(rename = "2015")] 138 #[serde(rename = "2015")]
@@ -153,7 +153,7 @@ impl From<EditionData> for Edition {
153 } 153 }
154} 154}
155 155
156#[derive(Deserialize)] 156#[derive(Deserialize, Debug, Clone)]
157struct DepData { 157struct DepData {
158 /// Identifies a crate by position in the crates array. 158 /// Identifies a crate by position in the crates array.
159 #[serde(rename = "crate")] 159 #[serde(rename = "crate")]
@@ -162,7 +162,7 @@ struct DepData {
162 name: CrateName, 162 name: CrateName,
163} 163}
164 164
165#[derive(Deserialize)] 165#[derive(Deserialize, Debug, Clone)]
166struct CrateSource { 166struct CrateSource {
167 include_dirs: Vec<PathBuf>, 167 include_dirs: Vec<PathBuf>,
168 exclude_dirs: Vec<PathBuf>, 168 exclude_dirs: Vec<PathBuf>,