Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Use serde instead of rustc_serialize #1436

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ test = false
path = "rls/src/main.rs"

[dependencies]
rls-analysis = "0.16.12"
rls-analysis = { version = "0.16.13", features = ["serialize-serde"], default-features = false }
rls-blacklist = "0.1.3"
rls-data = { version = "0.18.2", features = ["serialize-serde", "serialize-rustc"] }
rls-data = { version = "0.18.2", features = ["serialize-serde"] }
# FIXME: Release rls-rustc 0.6.0 to crates.io
rls-rustc = { version = "0.6.0", path = "rls-rustc" }
rls-span = { version = "0.4", features = ["serialize-serde"] }
Expand Down
2 changes: 1 addition & 1 deletion rls/src/build/external.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ where
let mut contents = String::new();
file.read_to_string(&mut contents).map_err(|e| e.to_string())?;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, from_read here should give some sweet perf improvements

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'd think, but that's unfortunately not the case in practice (the reason why I went with the string -> file flow in the first place but it seems to only affect reading)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow =/

let data = rustc_serialize::json::decode(&contents).map_err(|e| e.to_string())?;
let data = serde_json::from_str(&contents).map_err(|e| e.to_string())?;
analyses.push(data);
}

Expand Down