1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 22:00:03 -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

@@ -1,8 +1,8 @@
use egui::{
Color32, Painter, Pos2, Rect, Shape, Stroke, Ui, Vec2,
containers::{CollapsingHeader, Frame},
emath, pos2,
widgets::Slider,
Color32, Painter, Pos2, Rect, Shape, Stroke, Ui, Vec2,
};
use std::f32::consts::TAU;

View File

@@ -1,9 +1,9 @@
use egui::emath::Rot2;
use egui::panel::Side;
use egui::panel::TopBottomSide;
use egui::ImageFit;
use egui::Slider;
use egui::Vec2;
use egui::emath::Rot2;
use egui::panel::Side;
use egui::panel::TopBottomSide;
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub struct ImageViewer {

View File

@@ -53,7 +53,7 @@ impl FrameHistory {
}
fn graph(&self, ui: &mut egui::Ui) -> egui::Response {
use egui::{emath, epaint, pos2, vec2, Pos2, Rect, Sense, Shape, Stroke, TextStyle};
use egui::{Pos2, Rect, Sense, Shape, Stroke, TextStyle, emath, epaint, pos2, vec2};
ui.label("egui CPU usage history");

View File

@@ -16,7 +16,9 @@ fn main() -> eframe::Result {
start_puffin_server();
#[cfg(not(feature = "puffin"))]
panic!("Unknown argument: {arg} - you need to enable the 'puffin' feature to use this.");
panic!(
"Unknown argument: {arg} - you need to enable the 'puffin' feature to use this."
);
}
_ => {
@@ -39,7 +41,12 @@ fn main() -> eframe::Result {
rust_log += &format!(",{loud_crate}=warn");
}
}
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`).