From dc471c16b2a2d6ae68cb7668228d95a17afa6cbd Mon Sep 17 00:00:00 2001 From: Ali Bektas Date: Mon, 29 Jul 2024 17:00:31 +0200 Subject: [PATCH] Remove clippy errors --- .../crates/rust-analyzer/src/config.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs index 996f48482aa1..8743c4faff69 100644 --- a/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs +++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs @@ -758,6 +758,8 @@ pub enum RatomlFileKind { } #[derive(Debug, Clone)] +// FIXME @alibektas : Seems like a clippy warning of this sort should tell that combining different ConfigInputs into one enum was not a good idea. +#[allow(clippy::large_enum_variant)] enum RatomlFile { Workspace(GlobalLocalConfigInput), Crate(LocalConfigInput), @@ -2598,14 +2600,9 @@ macro_rules! _impl_for_config_data { $vis fn $field(&self, source_root : Option) -> &$ty { let mut source_root = source_root.as_ref(); while let Some(sr) = source_root { - if let Some((file, _)) = self.ratoml_file.get(&sr) { - match file { - RatomlFile::Workspace(config) => { - if let Some(v) = config.global.$field.as_ref() { - return &v; - } - }, - _ => () + if let Some((RatomlFile::Workspace(config), _)) = self.ratoml_file.get(&sr) { + if let Some(v) = config.global.$field.as_ref() { + return &v; } }