1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 14:49:06 -04:00

Use Rust edition 2024 (#7280)

This commit is contained in:
Emil Ernerfeldt
2025-06-30 14:01:57 +02:00
committed by GitHub
parent 962c8e26a8
commit b2995dcb83
190 changed files with 427 additions and 388 deletions

View File

@@ -3,7 +3,7 @@ name = "confirm_exit"
version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
edition = "2024"
rust-version = "1.85"
publish = false

View File

@@ -3,7 +3,7 @@ name = "custom_3d_glow"
version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
edition = "2024"
rust-version = "1.85"
publish = false

View File

@@ -3,7 +3,7 @@ name = "custom_font"
version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
edition = "2024"
rust-version = "1.85"
publish = false

View File

@@ -3,7 +3,7 @@ name = "custom_font_style"
version = "0.1.0"
authors = ["tami5 <kkharji@proton.me>"]
license = "MIT OR Apache-2.0"
edition = "2021"
edition = "2024"
rust-version = "1.85"
publish = false

View File

@@ -3,7 +3,7 @@ name = "custom_keypad"
version = "0.1.0"
authors = ["Varphone Wong <varphone@qq.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
edition = "2024"
rust-version = "1.85"
publish = false

View File

@@ -1,4 +1,4 @@
use eframe::egui::{self, pos2, vec2, Button, Ui, Vec2};
use eframe::egui::{self, Button, Ui, Vec2, pos2, vec2};
#[derive(Clone, Copy, Debug, Default, PartialEq)]
enum Transition {

View File

@@ -2,7 +2,7 @@
name = "custom_style"
version = "0.1.0"
license = "MIT OR Apache-2.0"
edition = "2021"
edition = "2024"
rust-version = "1.85"
publish = false

View File

@@ -2,7 +2,7 @@
#![allow(rustdoc::missing_crate_level_docs)] // it's an example
use eframe::egui::{
self, global_theme_preference_buttons, style::Selection, Color32, Stroke, Style, Theme,
self, Color32, Stroke, Style, Theme, global_theme_preference_buttons, style::Selection,
};
use egui_demo_lib::{View as _, WidgetGallery};

View File

@@ -3,7 +3,7 @@ name = "custom_window_frame"
version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
edition = "2024"
rust-version = "1.85"
publish = false

View File

@@ -75,7 +75,7 @@ fn custom_window_frame(ctx: &egui::Context, title: &str, add_contents: impl FnOn
}
fn title_bar_ui(ui: &mut egui::Ui, title_bar_rect: eframe::epaint::Rect, title: &str) {
use egui::{vec2, Align2, FontId, Id, PointerButton, Sense, UiBuilder};
use egui::{Align2, FontId, Id, PointerButton, Sense, UiBuilder, vec2};
let painter = ui.painter();

View File

@@ -3,7 +3,7 @@ name = "external_eventloop"
version = "0.1.0"
authors = ["Will Brown <opensource@rebeagle.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
edition = "2024"
rust-version = "1.85"
publish = false

View File

@@ -1,7 +1,7 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
#![allow(rustdoc::missing_crate_level_docs)] // it's an example
use eframe::{egui, UserEvent};
use eframe::{UserEvent, egui};
use std::{cell::Cell, rc::Rc};
use winit::event_loop::{ControlFlow, EventLoop};

View File

@@ -3,7 +3,7 @@ name = "external_eventloop_async"
version = "0.1.0"
authors = ["Will Brown <opensource@rebeagle.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
edition = "2024"
rust-version = "1.85"
publish = false

View File

@@ -1,4 +1,4 @@
use eframe::{egui, EframePumpStatus, UserEvent};
use eframe::{EframePumpStatus, UserEvent, egui};
use std::{cell::Cell, io, os::fd::AsRawFd as _, rc::Rc, time::Duration};
use tokio::task::LocalSet;
use winit::event_loop::{ControlFlow, EventLoop};

View File

@@ -3,7 +3,7 @@ name = "file_dialog"
version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
edition = "2024"
rust-version = "1.85"
publish = false

View File

@@ -3,7 +3,7 @@ name = "hello_android"
version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
edition = "2024"
rust-version = "1.85"
publish = false

View File

@@ -1,6 +1,6 @@
#![doc = include_str!("../README.md")]
use eframe::{egui, CreationContext};
use eframe::{CreationContext, egui};
#[cfg(target_os = "android")]
#[no_mangle]

View File

@@ -3,7 +3,7 @@ name = "hello_world"
version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
edition = "2024"
rust-version = "1.85"
publish = false

View File

@@ -3,7 +3,7 @@ name = "hello_world_par"
version = "0.1.0"
authors = ["Maxim Osipenko <maxim1999max@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
edition = "2024"
rust-version = "1.85"
publish = false

View File

@@ -3,7 +3,7 @@ name = "hello_world_simple"
version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
edition = "2024"
rust-version = "1.85"
publish = false

View File

@@ -3,7 +3,7 @@ name = "images"
version = "0.1.0"
authors = ["Jan Procházka <github.com/jprochazk>"]
license = "MIT OR Apache-2.0"
edition = "2021"
edition = "2024"
rust-version = "1.85"
publish = false

View File

@@ -3,7 +3,7 @@ name = "keyboard_events"
version = "0.1.0"
authors = ["Jose Palazon <jose@palako.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
edition = "2024"
rust-version = "1.85"
publish = false

View File

@@ -3,7 +3,7 @@ name = "multiple_viewports"
version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
edition = "2024"
rust-version = "1.85"
publish = false

View File

@@ -2,8 +2,8 @@
#![allow(rustdoc::missing_crate_level_docs)] // it's an example
use std::sync::{
atomic::{AtomicBool, Ordering},
Arc,
atomic::{AtomicBool, Ordering},
};
use eframe::egui;

View File

@@ -3,7 +3,7 @@ name = "puffin_profiler"
version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
edition = "2024"
rust-version = "1.85"
publish = false

View File

@@ -2,15 +2,21 @@
#![allow(rustdoc::missing_crate_level_docs)] // it's an example
use std::sync::{
atomic::{AtomicBool, Ordering},
Arc,
atomic::{AtomicBool, Ordering},
};
use eframe::egui;
fn main() -> eframe::Result {
let rust_log = std::env::var("RUST_LOG").unwrap_or_else(|_| "info".to_owned());
std::env::set_var("RUST_LOG", rust_log);
// SAFETY: we call this from the main thread without any other threads running.
#[expect(unsafe_code)]
unsafe {
std::env::set_var("RUST_LOG", rust_log);
};
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
start_puffin_server(); // NOTE: you may only want to call this if the users specifies some flag or clicks a button!

View File

@@ -6,7 +6,7 @@ authors = [
"Andreas Faber <andreas.mfaber@gmail.com",
]
license = "MIT OR Apache-2.0"
edition = "2021"
edition = "2024"
rust-version = "1.85"
publish = false

View File

@@ -3,7 +3,7 @@ name = "serial_windows"
version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
edition = "2024"
rust-version = "1.85"
publish = false

View File

@@ -3,7 +3,7 @@ name = "user_attention"
version = "0.1.0"
authors = ["TicClick <ya@ticclick.ch>"]
license = "MIT OR Apache-2.0"
edition = "2021"
edition = "2024"
rust-version = "1.85"
publish = false

View File

@@ -1,7 +1,7 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
#![allow(rustdoc::missing_crate_level_docs)] // it's an example
use eframe::{egui, CreationContext, NativeOptions};
use eframe::{CreationContext, NativeOptions, egui};
use egui::{Button, CentralPanel, Context, UserAttentionType};
use std::time::{Duration, SystemTime};