From f7a15b5cd1df58e46066bbd27c90cb1ad7f9c316 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 6 Jan 2021 13:54:28 +0300 Subject: 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 --- crates/project_model/src/project_json.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/project_model') 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 { } } -#[derive(Deserialize)] +#[derive(Deserialize, Debug, Clone)] pub struct ProjectJsonData { sysroot_src: Option, crates: Vec, } -#[derive(Deserialize)] +#[derive(Deserialize, Debug, Clone)] struct CrateData { display_name: Option, root_module: PathBuf, @@ -132,7 +132,7 @@ struct CrateData { source: Option, } -#[derive(Deserialize)] +#[derive(Deserialize, Debug, Clone)] #[serde(rename = "edition")] enum EditionData { #[serde(rename = "2015")] @@ -153,7 +153,7 @@ impl From for Edition { } } -#[derive(Deserialize)] +#[derive(Deserialize, Debug, Clone)] struct DepData { /// Identifies a crate by position in the crates array. #[serde(rename = "crate")] @@ -162,7 +162,7 @@ struct DepData { name: CrateName, } -#[derive(Deserialize)] +#[derive(Deserialize, Debug, Clone)] struct CrateSource { include_dirs: Vec, exclude_dirs: Vec, -- cgit v1.2.3