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:
parent
f606b0641e
commit
b1872e3afd
120 changed files with 1146 additions and 1267 deletions
|
@ -3,7 +3,9 @@ use std::io::{Cursor, Write};
|
|||
use crate::role::Role;
|
||||
use crate::LanguageModelToolUse;
|
||||
use base64::write::EncoderWriter;
|
||||
use gpui::{point, size, App, DevicePixels, Image, ObjectFit, RenderImage, Size, Task};
|
||||
use gpui::{
|
||||
point, size, App, AppContext as _, DevicePixels, Image, ObjectFit, RenderImage, Size, Task,
|
||||
};
|
||||
use image::{codecs::png::PngEncoder, imageops::resize, DynamicImage, ImageDecoder};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use ui::{px, SharedString};
|
||||
|
@ -30,7 +32,7 @@ const ANTHROPIC_SIZE_LIMT: f32 = 1568.;
|
|||
|
||||
impl LanguageModelImage {
|
||||
pub fn from_image(data: Image, cx: &mut App) -> Task<Option<Self>> {
|
||||
cx.background_executor().spawn(async move {
|
||||
cx.background_spawn(async move {
|
||||
match data.format() {
|
||||
gpui::ImageFormat::Png
|
||||
| gpui::ImageFormat::Jpeg
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue