Skip to content

Commit e30868e

Browse files
committed
rust: compilation database reading simplified
1 parent 14c2e01 commit e30868e

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

rust/bear/src/modes/semantic.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -218,15 +218,13 @@ impl ClangOutputWriter {
218218
.map(BufReader::new)
219219
.with_context(|| format!("Failed to open file: {:?}", source))?;
220220

221-
let entries = output::clang::read(file)
222-
.map(move |candidate| {
223-
// We are here to log the error.
224-
candidate.map_err(|error| {
225-
log::error!("Failed to read file: {:?}, reason: {}", source_copy, error);
226-
error
227-
})
228-
})
229-
.filter_map(Result::ok);
221+
let entries = output::clang::read(file).filter_map(move |candidate| match candidate {
222+
Ok(entry) => Some(entry),
223+
Err(error) => {
224+
log::error!("Failed to read file: {:?}, reason: {}", source_copy, error);
225+
None
226+
}
227+
});
230228
Ok(entries)
231229
}
232230
}

0 commit comments

Comments
 (0)