Centralize defaults

This commit is contained in:
Aleksey Kladov 2020-04-01 18:56:47 +02:00
parent 4936abdd49
commit 1ac345a9f6
2 changed files with 6 additions and 18 deletions

View File

@ -28,16 +28,6 @@ pub enum FlycheckConfig {
CustomCommand { command: String, args: Vec<String> },
}
impl Default for FlycheckConfig {
fn default() -> Self {
FlycheckConfig::CargoCommand {
command: "check".to_string(),
all_targets: true,
extra_args: Vec::new(),
}
}
}
/// Flycheck wraps the shared state and communication machinery used for
/// running `cargo check` (or other compatible command) and providing
/// diagnostics based on the output.

View File

@ -51,12 +51,6 @@ pub enum RustfmtConfig {
},
}
impl Default for RustfmtConfig {
fn default() -> Self {
RustfmtConfig::Rustfmt { extra_args: Vec::new() }
}
}
#[derive(Debug, Clone, Default)]
pub struct ClientCapsConfig {
pub location_link: bool,
@ -85,8 +79,12 @@ fn default() -> Self {
add_call_argument_snippets: true,
},
call_info_full: true,
rustfmt: RustfmtConfig::default(),
check: Some(FlycheckConfig::default()),
rustfmt: RustfmtConfig::Rustfmt { extra_args: Vec::new() },
check: Some(FlycheckConfig::CargoCommand {
command: "check".to_string(),
all_targets: true,
extra_args: Vec::new(),
}),
vscode_lldb: false,
proc_macro_srv: None,
lru_capacity: None,