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,9 +2,9 @@ use std::time::Duration;
use anyhow::Result;
use gpui::{
black, bounce, div, ease_in_out, percentage, prelude::*, px, rgb, size, svg, Animation,
AnimationExt as _, App, Application, AssetSource, Bounds, Context, SharedString,
Transformation, Window, WindowBounds, WindowOptions,
Animation, AnimationExt as _, App, Application, AssetSource, Bounds, Context, SharedString,
Transformation, Window, WindowBounds, WindowOptions, black, bounce, div, ease_in_out,
percentage, prelude::*, px, rgb, size, svg,
};
struct Assets {}

View file

@ -5,9 +5,9 @@ use std::{
};
use gpui::{
canvas, div, point, prelude::*, px, rgb, size, uniform_list, App, Application, Bounds, Context,
MouseDownEvent, MouseMoveEvent, MouseUpEvent, Pixels, Point, Render, SharedString,
UniformListScrollHandle, Window, WindowBounds, WindowOptions,
App, Application, Bounds, Context, MouseDownEvent, MouseMoveEvent, MouseUpEvent, Pixels, Point,
Render, SharedString, UniformListScrollHandle, Window, WindowBounds, WindowOptions, canvas,
div, point, prelude::*, px, rgb, size, uniform_list,
};
const TOTAL_ITEMS: usize = 10000;

View file

@ -1,4 +1,4 @@
use gpui::{div, img, prelude::*, App, Application, Context, Render, Window, WindowOptions};
use gpui::{App, Application, Context, Render, Window, WindowOptions, div, img, prelude::*};
use std::path::PathBuf;
struct GifViewer {

View file

@ -1,6 +1,6 @@
use gpui::{
canvas, div, linear_color_stop, linear_gradient, point, prelude::*, px, size, App, Application,
Bounds, ColorSpace, Context, Half, Render, Window, WindowOptions,
App, Application, Bounds, ColorSpace, Context, Half, Render, Window, WindowOptions, canvas,
div, linear_color_stop, linear_gradient, point, prelude::*, px, size,
};
struct GradientViewer {

View file

@ -1,6 +1,6 @@
use gpui::{
div, prelude::*, px, rgb, size, App, Application, Bounds, Context, SharedString, Window,
WindowBounds, WindowOptions,
App, Application, Bounds, Context, SharedString, Window, WindowBounds, WindowOptions, div,
prelude::*, px, rgb, size,
};
struct HelloWorld {

View file

@ -4,9 +4,9 @@ use std::sync::Arc;
use anyhow::Result;
use gpui::{
actions, div, img, prelude::*, px, rgb, size, App, AppContext, Application, AssetSource,
Bounds, Context, ImageSource, KeyBinding, Menu, MenuItem, Point, SharedString, SharedUri,
TitlebarOptions, Window, WindowBounds, WindowOptions,
App, AppContext, Application, AssetSource, Bounds, Context, ImageSource, KeyBinding, Menu,
MenuItem, Point, SharedString, SharedUri, TitlebarOptions, Window, WindowBounds, WindowOptions,
actions, div, img, prelude::*, px, rgb, size,
};
use reqwest_client::ReqwestClient;

View file

@ -2,10 +2,10 @@ use std::{path::Path, sync::Arc, time::Duration};
use anyhow::anyhow;
use gpui::{
black, div, img, prelude::*, pulsating_between, px, red, size, Animation, AnimationExt, App,
Application, Asset, AssetLogger, AssetSource, Bounds, Context, Hsla, ImageAssetLoader,
ImageCacheError, ImgResourceLoader, Length, Pixels, RenderImage, Resource, SharedString,
Window, WindowBounds, WindowOptions, LOADING_DELAY,
Animation, AnimationExt, App, Application, Asset, AssetLogger, AssetSource, Bounds, Context,
Hsla, ImageAssetLoader, ImageCacheError, ImgResourceLoader, LOADING_DELAY, Length, Pixels,
RenderImage, Resource, SharedString, Window, WindowBounds, WindowOptions, black, div, img,
prelude::*, pulsating_between, px, red, size,
};
struct Assets {}

View file

@ -1,12 +1,12 @@
use std::ops::Range;
use gpui::{
actions, black, div, fill, hsla, opaque_grey, point, prelude::*, px, relative, rgb, rgba, size,
white, yellow, App, Application, Bounds, ClipboardItem, Context, CursorStyle, ElementId,
ElementInputHandler, Entity, EntityInputHandler, FocusHandle, Focusable, GlobalElementId,
KeyBinding, Keystroke, LayoutId, MouseButton, MouseDownEvent, MouseMoveEvent, MouseUpEvent,
PaintQuad, Pixels, Point, ShapedLine, SharedString, Style, TextRun, UTF16Selection,
UnderlineStyle, Window, WindowBounds, WindowOptions,
App, Application, Bounds, ClipboardItem, Context, CursorStyle, ElementId, ElementInputHandler,
Entity, EntityInputHandler, FocusHandle, Focusable, GlobalElementId, KeyBinding, Keystroke,
LayoutId, MouseButton, MouseDownEvent, MouseMoveEvent, MouseUpEvent, PaintQuad, Pixels, Point,
ShapedLine, SharedString, Style, TextRun, UTF16Selection, UnderlineStyle, Window, WindowBounds,
WindowOptions, actions, black, div, fill, hsla, opaque_grey, point, prelude::*, px, relative,
rgb, rgba, size, white, yellow,
};
use unicode_segmentation::*;

View file

@ -1,6 +1,6 @@
use gpui::{
actions, div, prelude::*, px, rgb, size, App, Application, Bounds, Context, FocusHandle,
KeyBinding, Window, WindowBounds, WindowOptions,
App, Application, Bounds, Context, FocusHandle, KeyBinding, Window, WindowBounds,
WindowOptions, actions, div, prelude::*, px, rgb, size,
};
actions!(example, [CloseWindow]);

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;
}
}
}));
}

View file

@ -1,4 +1,4 @@
use gpui::{prelude::*, App, Application, Context, Entity, EventEmitter};
use gpui::{App, Application, Context, Entity, EventEmitter, prelude::*};
struct Counter {
count: usize,

View file

@ -1,7 +1,7 @@
use gpui::{
canvas, div, linear_color_stop, linear_gradient, point, prelude::*, px, rgb, size, Application,
Background, Bounds, ColorSpace, Context, MouseDownEvent, Path, PathBuilder, PathStyle, Pixels,
Point, Render, StrokeOptions, Window, WindowOptions,
Application, Background, Bounds, ColorSpace, Context, MouseDownEvent, Path, PathBuilder,
PathStyle, Pixels, Point, Render, StrokeOptions, Window, WindowOptions, canvas, div,
linear_color_stop, linear_gradient, point, prelude::*, px, rgb, size,
};
struct PaintingViewer {

View file

@ -1,6 +1,6 @@
use gpui::{
div, linear_color_stop, linear_gradient, pattern_slash, prelude::*, px, rgb, size, App,
AppContext, Application, Bounds, Context, Window, WindowBounds, WindowOptions,
App, AppContext, Application, Bounds, Context, Window, WindowBounds, WindowOptions, div,
linear_color_stop, linear_gradient, pattern_slash, prelude::*, px, rgb, size,
};
struct PatternExample;

View file

@ -1,5 +1,5 @@
use gpui::{
actions, div, prelude::*, rgb, App, Application, Context, Menu, MenuItem, Window, WindowOptions,
App, Application, Context, Menu, MenuItem, Window, WindowOptions, actions, div, prelude::*, rgb,
};
struct SetMenus;

View file

@ -1,6 +1,6 @@
use gpui::{
div, hsla, point, prelude::*, px, relative, rgb, size, App, Application, Bounds, BoxShadow,
Context, Div, SharedString, Window, WindowBounds, WindowOptions,
App, Application, Bounds, BoxShadow, Context, Div, SharedString, Window, WindowBounds,
WindowOptions, div, hsla, point, prelude::*, px, relative, rgb, size,
};
use smallvec::smallvec;

View file

@ -3,8 +3,8 @@ use std::path::PathBuf;
use anyhow::Result;
use gpui::{
div, prelude::*, px, rgb, size, svg, App, Application, AssetSource, Bounds, Context,
SharedString, Window, WindowBounds, WindowOptions,
App, Application, AssetSource, Bounds, Context, SharedString, Window, WindowBounds,
WindowOptions, div, prelude::*, px, rgb, size, svg,
};
struct Assets {

View file

@ -1,6 +1,6 @@
use gpui::{
div, prelude::*, px, size, App, Application, Bounds, Context, Window, WindowBounds,
WindowOptions,
App, Application, Bounds, Context, Window, WindowBounds, WindowOptions, div, prelude::*, px,
size,
};
struct HelloWorld {}

View file

@ -1,6 +1,6 @@
use gpui::{
div, prelude::*, px, size, App, Application, Bounds, Context, TextOverflow, Window,
WindowBounds, WindowOptions,
App, Application, Bounds, Context, TextOverflow, Window, WindowBounds, WindowOptions, div,
prelude::*, px, size,
};
struct HelloWorld {}

View file

@ -1,6 +1,6 @@
use gpui::{
div, prelude::*, px, rgb, size, uniform_list, App, Application, Bounds, Context, Window,
WindowBounds, WindowOptions,
App, Application, Bounds, Context, Window, WindowBounds, WindowOptions, div, prelude::*, px,
rgb, size, uniform_list,
};
struct UniformListExample {}

View file

@ -1,6 +1,6 @@
use gpui::{
div, prelude::*, px, rgb, size, App, Application, Bounds, Context, SharedString, Timer, Window,
WindowBounds, WindowKind, WindowOptions,
App, Application, Bounds, Context, SharedString, Timer, Window, WindowBounds, WindowKind,
WindowOptions, div, prelude::*, px, rgb, size,
};
struct SubWindow {

View file

@ -1,7 +1,7 @@
use gpui::{
div, point, prelude::*, px, rgb, App, Application, Bounds, Context, DisplayId, Hsla, Pixels,
SharedString, Size, Window, WindowBackgroundAppearance, WindowBounds, WindowKind,
WindowOptions,
App, Application, Bounds, Context, DisplayId, Hsla, Pixels, SharedString, Size, Window,
WindowBackgroundAppearance, WindowBounds, WindowKind, WindowOptions, div, point, prelude::*,
px, rgb,
};
struct WindowContent {

View file

@ -1,8 +1,8 @@
use gpui::{
black, canvas, div, green, point, prelude::*, px, rgb, size, transparent_black, white, App,
Application, Bounds, Context, CursorStyle, Decorations, Hsla, MouseButton, Pixels, Point,
App, Application, Bounds, Context, CursorStyle, Decorations, Hsla, MouseButton, Pixels, Point,
ResizeEdge, Size, Window, WindowBackgroundAppearance, WindowBounds, WindowDecorations,
WindowOptions,
WindowOptions, black, canvas, div, green, point, prelude::*, px, rgb, size, transparent_black,
white,
};
struct WindowShadow {}