refactor: Clean up cache priming cancellation handling

This commit is contained in:
Lukas Wirth 2025-04-29 10:40:06 +02:00
parent fe7b4f2ad9
commit 7d9b839f9c
7 changed files with 54 additions and 39 deletions

View file

@ -701,10 +701,9 @@ impl flags::AnalysisStats {
if self.parallel {
let mut inference_sw = self.stop_watch();
let snap = db.snapshot();
bodies
.par_iter()
.map_with(snap, |snap, &body| {
.map_with(db.clone(), |snap, &body| {
snap.body(body.into());
snap.infer(body.into());
})

View file

@ -126,10 +126,8 @@ impl CargoParser<DiscoverProjectMessage> for DiscoverProjectParser {
Some(msg)
}
Err(err) => {
let err = DiscoverProjectData::Error {
error: format!("{:#?}\n{}", err, line),
source: None,
};
let err =
DiscoverProjectData::Error { error: format!("{err:#?}\n{line}"), source: None };
Some(DiscoverProjectMessage::new(err))
}
}