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:
@@ -7580,13 +7580,13 @@ pub fn create_and_open_local_file(
|
||||
path: &'static Path,
|
||||
window: &mut Window,
|
||||
cx: &mut Context<Workspace>,
|
||||
default_content: impl 'static + Send + FnOnce() -> Rope,
|
||||
default_content: impl 'static + Send + FnOnce(&mut AsyncApp) -> Rope,
|
||||
) -> Task<Result<Box<dyn ItemHandle>>> {
|
||||
cx.spawn_in(window, async move |workspace, cx| {
|
||||
let fs = workspace.read_with(cx, |workspace, _| workspace.app_state().fs.clone())?;
|
||||
if !fs.is_file(path).await {
|
||||
fs.create_file(path, Default::default()).await?;
|
||||
fs.save(path, &default_content(), Default::default())
|
||||
fs.save(path, &default_content(cx), Default::default())
|
||||
.await?;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user