Skip to content

Commit 6a694ad

Browse files
committed
Minor
1 parent 57ed622 commit 6a694ad

File tree

2 files changed

+9
-22
lines changed

2 files changed

+9
-22
lines changed

crates/ra_project_model/src/cargo_workspace.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl ops::Index<Target> for CargoWorkspace {
4545
}
4646
}
4747

48-
#[derive(Clone, Debug, PartialEq, Eq)]
48+
#[derive(Default, Clone, Debug, PartialEq, Eq)]
4949
pub struct CargoConfig {
5050
/// Do not activate the `default` feature.
5151
pub no_default_features: bool,
@@ -64,18 +64,6 @@ pub struct CargoConfig {
6464
pub target: Option<String>,
6565
}
6666

67-
impl Default for CargoConfig {
68-
fn default() -> Self {
69-
CargoConfig {
70-
no_default_features: false,
71-
all_features: false,
72-
features: Vec::new(),
73-
load_out_dirs_from_check: false,
74-
target: None,
75-
}
76-
}
77-
}
78-
7967
pub type Package = Idx<PackageData>;
8068

8169
pub type Target = Idx<TargetData>;

crates/rust-analyzer/src/reload.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,15 @@ impl GlobalState {
2727
}
2828
pub(crate) fn reload(&mut self) {
2929
log::info!("reloading projects: {:?}", self.config.linked_projects);
30-
let workspaces = {
31-
if self.config.linked_projects.is_empty()
32-
&& self.config.notifications.cargo_toml_not_found
33-
{
34-
self.show_message(
35-
lsp_types::MessageType::Error,
36-
"rust-analyzer failed to discover workspace".to_string(),
37-
);
38-
};
30+
if self.config.linked_projects.is_empty() && self.config.notifications.cargo_toml_not_found
31+
{
32+
self.show_message(
33+
lsp_types::MessageType::Error,
34+
"rust-analyzer failed to discover workspace".to_string(),
35+
);
36+
};
3937

38+
let workspaces = {
4039
self.config
4140
.linked_projects
4241
.iter()

0 commit comments

Comments
 (0)