aboutsummaryrefslogtreecommitdiff
path: root/crates/rust-analyzer/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/rust-analyzer/src/lib.rs')
-rw-r--r--crates/rust-analyzer/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/lib.rs b/crates/rust-analyzer/src/lib.rs
index 682fa5f7f..c9494e300 100644
--- a/crates/rust-analyzer/src/lib.rs
+++ b/crates/rust-analyzer/src/lib.rs
@@ -47,7 +47,7 @@ pub type Error = Box<dyn std::error::Error + Send + Sync>;
47pub type Result<T, E = Error> = std::result::Result<T, E>; 47pub type Result<T, E = Error> = std::result::Result<T, E>;
48 48
49pub fn from_json<T: DeserializeOwned>(what: &'static str, json: serde_json::Value) -> Result<T> { 49pub fn from_json<T: DeserializeOwned>(what: &'static str, json: serde_json::Value) -> Result<T> {
50 let res = T::deserialize(&json) 50 let res = serde_path_to_error::deserialize(&json)
51 .map_err(|e| format!("Failed to deserialize {}: {}; {}", what, e, json))?; 51 .map_err(|e| format!("Failed to deserialize {}: {}; {}", what, e, json))?;
52 Ok(res) 52 Ok(res)
53} 53}