Unnamed repository; edit this file 'description' to name the repository.
Apply changes to ratoml/fixes
Ali Bektas 2024-07-22
parent 97bad35 · commit 4f8735f
-rw-r--r--crates/rust-analyzer/src/config.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs
index 159098d120..00b4d185c0 100644
--- a/crates/rust-analyzer/src/config.rs
+++ b/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<T: DeserializeOwned>(
})
}
-fn get_field_toml<T: DeserializeOwned>(
+fn get_field_toml<T: DeserializeOwned + fmt::Debug>(
toml: &toml::Table,
error_sink: &mut Vec<(String, toml::de::Error)>,
field: &'static str,
@@ -2847,12 +2846,17 @@ fn get_field_toml<T: DeserializeOwned>(
.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::<T>());
+ <_>::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));