mirror of
https://github.com/zed-industries/zed.git
synced 2026-12-03 05:51:27 +01:00
cx.background_executor().spawn(...) -> cx.background_spawn(...) (#25103)
Done automatically with
> ast-grep -p '$A.background_executor().spawn($B)' -r
'$A.background_spawn($B)' --update-all --globs "\!crates/gpui"
Followed by:
* `cargo fmt`
* Unexpected need to remove some trailing whitespace.
* Manually adding imports of `gpui::{AppContext as _}` which provides
`background_spawn`
* Added `AppContext as _` to existing use of `AppContext`
Release Notes:
- N/A
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use collections::{HashMap, HashSet};
|
||||
use git::diff::DiffHunkStatus;
|
||||
use gpui::{
|
||||
Action, AppContext, Corner, CursorStyle, Focusable as _, Hsla, Model, MouseButton,
|
||||
Action, AppContext as _, Corner, CursorStyle, Focusable as _, Hsla, Model, MouseButton,
|
||||
Subscription, Task,
|
||||
};
|
||||
use language::{Buffer, BufferId, Point};
|
||||
@@ -372,7 +372,7 @@ impl Editor {
|
||||
|
||||
self.diff_map
|
||||
.hunk_update_tasks
|
||||
.insert(None, cx.background_executor().spawn(new_toggle_task));
|
||||
.insert(None, cx.background_spawn(new_toggle_task));
|
||||
}
|
||||
|
||||
pub(super) fn expand_diff_hunk(
|
||||
@@ -1089,10 +1089,9 @@ impl Editor {
|
||||
.ok();
|
||||
});
|
||||
|
||||
diff_map.hunk_update_tasks.insert(
|
||||
Some(buffer_id),
|
||||
cx.background_executor().spawn(new_sync_task),
|
||||
);
|
||||
diff_map
|
||||
.hunk_update_tasks
|
||||
.insert(Some(buffer_id), cx.background_spawn(new_sync_task));
|
||||
}
|
||||
|
||||
fn go_to_subsequent_hunk(
|
||||
|
||||
Reference in New Issue
Block a user