sum_tree: Replace rayon with futures (#41586)
Release Notes: - N/A *or* Added/Fixed/Improved ... Co-authored by: Kate <kate@zed.dev>
This commit is contained in:
@@ -1468,6 +1468,7 @@ impl ExtensionStore {
|
||||
let extensions_dir = self.installed_dir.clone();
|
||||
let index_path = self.index_path.clone();
|
||||
let proxy = self.proxy.clone();
|
||||
let executor = cx.background_executor().clone();
|
||||
cx.background_spawn(async move {
|
||||
let start_time = Instant::now();
|
||||
let mut index = ExtensionIndex::default();
|
||||
@@ -1501,10 +1502,14 @@ impl ExtensionStore {
|
||||
}
|
||||
|
||||
if let Ok(index_json) = serde_json::to_string_pretty(&index) {
|
||||
fs.save(&index_path, &index_json.as_str().into(), Default::default())
|
||||
.await
|
||||
.context("failed to save extension index")
|
||||
.log_err();
|
||||
fs.save(
|
||||
&index_path,
|
||||
&Rope::from_str(&index_json, &executor),
|
||||
Default::default(),
|
||||
)
|
||||
.await
|
||||
.context("failed to save extension index")
|
||||
.log_err();
|
||||
}
|
||||
|
||||
log::info!("rebuilt extension index in {:?}", start_time.elapsed());
|
||||
@@ -1671,7 +1676,7 @@ impl ExtensionStore {
|
||||
let manifest_toml = toml::to_string(&loaded_extension.manifest)?;
|
||||
fs.save(
|
||||
&tmp_dir.join(EXTENSION_TOML),
|
||||
&Rope::from(manifest_toml),
|
||||
&Rope::from_str_small(&manifest_toml),
|
||||
language::LineEnding::Unix,
|
||||
)
|
||||
.await?;
|
||||
|
||||
Reference in New Issue
Block a user