From a97e5eb85d1a8a2a07663abbd9beaae317fdb24d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 1 Apr 2020 18:41:43 +0200 Subject: Centralize all config --- crates/ra_flycheck/src/lib.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'crates/ra_flycheck/src') diff --git a/crates/ra_flycheck/src/lib.rs b/crates/ra_flycheck/src/lib.rs index 13494a731..f3d6f8f5f 100644 --- a/crates/ra_flycheck/src/lib.rs +++ b/crates/ra_flycheck/src/lib.rs @@ -22,12 +22,22 @@ use crate::conv::{map_rust_diagnostic_to_lsp, MappedRustDiagnostic}; pub use crate::conv::url_from_path_with_drive_lowercasing; -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq, Eq)] pub enum FlycheckConfig { CargoCommand { command: String, all_targets: bool, extra_args: Vec }, CustomCommand { command: String, args: Vec }, } +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. -- cgit v1.2.3 From 1ac345a9f693e54aecd2ad70731acc75f982d2ae Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 1 Apr 2020 18:56:47 +0200 Subject: Centralize defaults --- crates/ra_flycheck/src/lib.rs | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'crates/ra_flycheck/src') diff --git a/crates/ra_flycheck/src/lib.rs b/crates/ra_flycheck/src/lib.rs index f3d6f8f5f..b54a30ab8 100644 --- a/crates/ra_flycheck/src/lib.rs +++ b/crates/ra_flycheck/src/lib.rs @@ -28,16 +28,6 @@ pub enum FlycheckConfig { CustomCommand { command: String, args: Vec }, } -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. -- cgit v1.2.3