Skip to content

Commit

Permalink
remove clone and parallelize
Browse files Browse the repository at this point in the history
  • Loading branch information
Feel-ix-343 committed Mar 11, 2024
1 parent ec133d8 commit 38b1744
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,12 @@ impl Backend {
}

async fn publish_diagnostics(&self) -> Result<()> {
let urls = self.bind_opened_files(|files| Ok(files.clone())).await?;
let uris = urls
.into_iter()
.filter_map(|url| Url::from_file_path(url).ok())
.collect_vec();
let uris = self.bind_opened_files(|files| {
Ok(files
.into_par_iter()
.filter_map(|url| Url::from_file_path(url).ok())
.collect::<Vec<_>>())
}).await?;

let diagnostics = self
.bind_vault(|vault| {
Expand Down

0 comments on commit 38b1744

Please sign in to comment.