Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #132 Failed to parse compiler message #133

Merged
merged 2 commits into from Oct 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -10,7 +10,7 @@ edition = "2018"

[dependencies]
serde = { version = "1.0.107", features = ["derive"] }
serde_json = "1.0.1"
serde_json = { version = "1.0.59", features = ["unbounded_depth"] }

[dependencies.semver]
features = ["serde"]
Expand Down
6 changes: 5 additions & 1 deletion src/messages.rs
Expand Up @@ -144,7 +144,11 @@ impl<R: BufRead> Iterator for MessageIter<R> {
type Item = io::Result<Message>;
fn next(&mut self) -> Option<Self::Item> {
let line = self.lines.next()?;
let message = line.map(|it| serde_json::from_str(&it).unwrap_or(Message::TextLine(it)));
let message = line.map(|it| {
let mut deserializer = serde_json::Deserializer::from_str(&it);
deserializer.disable_recursion_limit();
Message::deserialize(&mut deserializer).unwrap_or(Message::TextLine(it))
});
Some(message)
}
}
Expand Down