]> git.lizzy.rs Git - rust.git/commitdiff
Minor
authorAleksey Kladov <aleksey.kladov@gmail.com>
Thu, 2 Jul 2020 14:06:00 +0000 (16:06 +0200)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Thu, 2 Jul 2020 14:06:00 +0000 (16:06 +0200)
crates/ra_project_model/src/cargo_workspace.rs
crates/rust-analyzer/src/reload.rs

index 47a1d393dbf47576616dad953ec83dfeca4c011d..361fc8eea6aef2c65f7492e4e1089820d1e57f80 100644 (file)
@@ -45,7 +45,7 @@ fn index(&self, index: Target) -> &TargetData {
     }
 }
 
-#[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<String>,
 }
 
-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<PackageData>;
 
 pub type Target = Idx<TargetData>;
index 0c1fd1b8b5b06d297f9dfa18fdf296b9492ca4d6..07c08deae665e8d9b4e9095f672143f6b393cb2f 100644 (file)
@@ -27,16 +27,15 @@ pub(crate) fn update_configuration(&mut self, config: Config) {
     }
     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()