From 6a694ad047802e6e5aec8522556d2db09c10b18f Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 2 Jul 2020 16:06:00 +0200 Subject: [PATCH] Minor --- crates/ra_project_model/src/cargo_workspace.rs | 14 +------------- crates/rust-analyzer/src/reload.rs | 17 ++++++++--------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/crates/ra_project_model/src/cargo_workspace.rs b/crates/ra_project_model/src/cargo_workspace.rs index 47a1d393dbf..361fc8eea6a 100644 --- a/crates/ra_project_model/src/cargo_workspace.rs +++ b/crates/ra_project_model/src/cargo_workspace.rs @@ -45,7 +45,7 @@ impl ops::Index for CargoWorkspace { } } -#[derive(Clone, Debug, PartialEq, Eq)] +#[derive(Default, Clone, Debug, PartialEq, Eq)] pub struct CargoConfig { /// Do not activate the `default` feature. pub no_default_features: bool, @@ -64,18 +64,6 @@ pub struct CargoConfig { pub target: Option, } -impl Default for CargoConfig { - fn default() -> Self { - CargoConfig { - no_default_features: false, - all_features: false, - features: Vec::new(), - load_out_dirs_from_check: false, - target: None, - } - } -} - pub type Package = Idx; pub type Target = Idx; diff --git a/crates/rust-analyzer/src/reload.rs b/crates/rust-analyzer/src/reload.rs index 0c1fd1b8b5b..07c08deae66 100644 --- a/crates/rust-analyzer/src/reload.rs +++ b/crates/rust-analyzer/src/reload.rs @@ -27,16 +27,15 @@ impl GlobalState { } pub(crate) fn reload(&mut self) { log::info!("reloading projects: {:?}", self.config.linked_projects); - let workspaces = { - if self.config.linked_projects.is_empty() - && self.config.notifications.cargo_toml_not_found - { - self.show_message( - lsp_types::MessageType::Error, - "rust-analyzer failed to discover workspace".to_string(), - ); - }; + if self.config.linked_projects.is_empty() && self.config.notifications.cargo_toml_not_found + { + self.show_message( + lsp_types::MessageType::Error, + "rust-analyzer failed to discover workspace".to_string(), + ); + }; + let workspaces = { self.config .linked_projects .iter()