]> git.lizzy.rs Git - rust.git/blobdiff - crates/rust-analyzer/src/lib.rs
Replaced fold with for loop
[rust.git] / crates / rust-analyzer / src / lib.rs
index d538ad69a1243fcd7151ccab6aaca503f47fd096..d29ec512d6193ecbf9d70bfe6c6502d2fa6edc20 100644 (file)
@@ -29,24 +29,29 @@ macro_rules! eprintln {
 mod semantic_tokens;
 mod markdown;
 mod diagnostics;
-mod line_endings;
-mod request_metrics;
+mod line_index;
 mod lsp_utils;
 mod thread_pool;
-mod document;
+mod mem_docs;
+mod diff;
+mod op_queue;
 pub mod lsp_ext;
 pub mod config;
 
-use serde::de::DeserializeOwned;
+#[cfg(test)]
+mod integrated_benchmarks;
+
 use std::fmt;
 
+use serde::de::DeserializeOwned;
+
 pub use crate::{caps::server_capabilities, main_loop::main_loop};
 
 pub type Error = Box<dyn std::error::Error + Send + Sync>;
 pub type Result<T, E = Error> = std::result::Result<T, E>;
 
 pub fn from_json<T: DeserializeOwned>(what: &'static str, json: serde_json::Value) -> Result<T> {
-    let res = serde_path_to_error::deserialize(&json)
+    let res = serde_json::from_value(json.clone())
         .map_err(|e| format!("Failed to deserialize {}: {}; {}", what, e, json))?;
     Ok(res)
 }