chore: Bump Rust edition to 2024 (#27800)

Follow-up to https://github.com/zed-industries/zed/pull/27791

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-03-31 20:55:27 +02:00 committed by GitHub
parent d50905e000
commit dc64ec9cc8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
802 changed files with 3775 additions and 3662 deletions

View file

@ -2,8 +2,9 @@ use std::{fs, path::PathBuf, time::Duration};
use anyhow::Result;
use gpui::{
div, hsla, img, point, prelude::*, px, rgb, size, svg, App, Application, AssetSource, Bounds,
BoxShadow, ClickEvent, Context, SharedString, Task, Timer, Window, WindowBounds, WindowOptions,
App, Application, AssetSource, Bounds, BoxShadow, ClickEvent, Context, SharedString, Task,
Timer, Window, WindowBounds, WindowOptions, div, hsla, img, point, prelude::*, px, rgb, size,
svg,
};
struct Assets {
@ -50,23 +51,25 @@ impl HelloWorld {
self.opacity = 0.0;
cx.notify();
self._task = Some(cx.spawn_in(window, async move |view, cx| loop {
Timer::after(Duration::from_secs_f32(0.05)).await;
let mut stop = false;
let _ = cx.update(|_, cx| {
view.update(cx, |view, cx| {
if view.opacity >= 1.0 {
stop = true;
return;
}
self._task = Some(cx.spawn_in(window, async move |view, cx| {
loop {
Timer::after(Duration::from_secs_f32(0.05)).await;
let mut stop = false;
let _ = cx.update(|_, cx| {
view.update(cx, |view, cx| {
if view.opacity >= 1.0 {
stop = true;
return;
}
view.opacity += 0.1;
cx.notify();
})
});
view.opacity += 0.1;
cx.notify();
})
});
if stop {
break;
if stop {
break;
}
}
}));
}