Skip to content

Commit 1ac345a

Browse files
committed
Centralize defaults
1 parent 4936abd commit 1ac345a

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

crates/ra_flycheck/src/lib.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,6 @@ pub enum FlycheckConfig {
2828
CustomCommand { command: String, args: Vec<String> },
2929
}
3030

31-
impl Default for FlycheckConfig {
32-
fn default() -> Self {
33-
FlycheckConfig::CargoCommand {
34-
command: "check".to_string(),
35-
all_targets: true,
36-
extra_args: Vec::new(),
37-
}
38-
}
39-
}
40-
4131
/// Flycheck wraps the shared state and communication machinery used for
4232
/// running `cargo check` (or other compatible command) and providing
4333
/// diagnostics based on the output.

crates/rust-analyzer/src/config.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ pub enum RustfmtConfig {
5151
},
5252
}
5353

54-
impl Default for RustfmtConfig {
55-
fn default() -> Self {
56-
RustfmtConfig::Rustfmt { extra_args: Vec::new() }
57-
}
58-
}
59-
6054
#[derive(Debug, Clone, Default)]
6155
pub struct ClientCapsConfig {
6256
pub location_link: bool,
@@ -85,8 +79,12 @@ impl Default for Config {
8579
add_call_argument_snippets: true,
8680
},
8781
call_info_full: true,
88-
rustfmt: RustfmtConfig::default(),
89-
check: Some(FlycheckConfig::default()),
82+
rustfmt: RustfmtConfig::Rustfmt { extra_args: Vec::new() },
83+
check: Some(FlycheckConfig::CargoCommand {
84+
command: "check".to_string(),
85+
all_targets: true,
86+
extra_args: Vec::new(),
87+
}),
9088
vscode_lldb: false,
9189
proc_macro_srv: None,
9290
lru_capacity: None,

0 commit comments

Comments
 (0)