Skip to content

Commit 92da7e9

Browse files
committed
internal: optimize compile time
cargo llvm-lines shows that path_to_error bloats the code. I don't think I've needed this functionality recently, seems that we've fixed most of the serialization problems. So let's just remove it. Should be easy to add back if we ever need it, and it does make sense to keep the `from_json` function around.
1 parent 182a2b8 commit 92da7e9

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

Cargo.lock

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/rust-analyzer/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ oorandom = "11.1.2"
3131
rustc-hash = "1.1.0"
3232
serde = { version = "1.0.106", features = ["derive"] }
3333
serde_json = { version = "1.0.48", features = ["preserve_order"] }
34-
serde_path_to_error = "0.1"
3534
threadpool = "1.7.1"
3635
rayon = "1.5"
3736
mimalloc = { version = "0.1.19", default-features = false, optional = true }

crates/rust-analyzer/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,17 @@ pub mod config;
4141
#[cfg(test)]
4242
mod integrated_benchmarks;
4343

44-
use serde::de::DeserializeOwned;
4544
use std::fmt;
4645

46+
use serde::de::DeserializeOwned;
47+
4748
pub use crate::{caps::server_capabilities, main_loop::main_loop};
4849

4950
pub type Error = Box<dyn std::error::Error + Send + Sync>;
5051
pub type Result<T, E = Error> = std::result::Result<T, E>;
5152

5253
pub fn from_json<T: DeserializeOwned>(what: &'static str, json: serde_json::Value) -> Result<T> {
53-
let res = serde_path_to_error::deserialize(&json)
54+
let res = serde_json::from_value(json.clone())
5455
.map_err(|e| format!("Failed to deserialize {}: {}; {}", what, e, json))?;
5556
Ok(res)
5657
}

0 commit comments

Comments
 (0)