From 65627d1c547124741ffc8f194332fd5a74e83f38 Mon Sep 17 00:00:00 2001 From: Ali Bektas Date: Sun, 21 Jul 2024 22:49:05 +0200 Subject: [PATCH] Apply changes to ratoml/fixes --- .../crates/rust-analyzer/src/config.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 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 159098d120c8..00b4d185c052 100644 --- a/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs +++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs @@ -892,7 +892,6 @@ impl Config { SnippetScopeDef::Type => SnippetScope::Type, SnippetScopeDef::Item => SnippetScope::Item, }; - #[allow(clippy::single_match)] match Snippet::new( &def.prefix, &def.postfix, @@ -2833,7 +2832,7 @@ fn get_field( }) } -fn get_field_toml( +fn get_field_toml( toml: &toml::Table, error_sink: &mut Vec<(String, toml::de::Error)>, field: &'static str, @@ -2847,12 +2846,17 @@ fn get_field_toml( .filter_map(move |field| { let mut pointer = field.replace('_', "/"); pointer.insert(0, '/'); - toml_pointer(toml, &pointer) - .map(|it| <_>::deserialize(it.clone()).map_err(|e| (e, pointer))) + toml_pointer(toml, &pointer).map(|it| { + dbg!(&pointer, std::any::type_name::()); + <_>::deserialize(it.clone()).map_err(|e| (e, pointer)) + }) }) .find(Result::is_ok) .and_then(|res| match res { - Ok(it) => Some(it), + Ok(it) => { + dbg!(&it); + Some(it) + } Err((e, pointer)) => { tracing::warn!("Failed to deserialize config field at {}: {:?}", pointer, e); error_sink.push((pointer, e));