Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.

Commit 7495251

Browse files
committed
Don't loop{} on errors during suggestion parsing
1 parent a71ff8a commit 7495251

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ use diagnostics::{Diagnostic, DiagnosticSpan};
1010
pub fn get_suggestions_from_json<S: ::std::hash::BuildHasher>(input: &str, only: &HashSet<String, S>) -> Vec<Suggestion> {
1111
serde_json::Deserializer::from_str(input)
1212
.into_iter::<Diagnostic>()
13-
// eat parsing errors
14-
.flat_map(|line| line.ok())
1513
// One diagnostic line might have multiple suggestions
16-
.filter_map(|cargo_msg| collect_suggestions(&cargo_msg, only))
14+
.filter_map(|cargo_msg| collect_suggestions(&cargo_msg.unwrap(), only))
1715
.collect()
1816
}
1917

0 commit comments

Comments
 (0)