1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 14:20:04 -04:00

Enable more clippy lints (#6853)

* Follows https://github.com/emilk/egui/pull/6848
This commit is contained in:
Emil Ernerfeldt
2025-04-24 17:32:50 +02:00
committed by GitHub
parent fdb9aa282a
commit f9245954eb
124 changed files with 243 additions and 244 deletions

View File

@@ -80,7 +80,7 @@ struct RotatingTriangle {
vertex_array: glow::VertexArray,
}
#[allow(unsafe_code)] // we need unsafe code to use glow
#[expect(unsafe_code)] // we need unsafe code to use glow
impl RotatingTriangle {
fn new(gl: &glow::Context) -> Option<Self> {
use glow::HasContext as _;

View File

@@ -1,7 +1,7 @@
use std::num::NonZeroU64;
use eframe::{
egui_wgpu::wgpu::util::DeviceExt,
egui_wgpu::wgpu::util::DeviceExt as _,
egui_wgpu::{self, wgpu},
};

View File

@@ -110,7 +110,7 @@ impl BackendPanel {
if cfg!(debug_assertions) && cfg!(target_arch = "wasm32") {
ui.separator();
// For testing panic handling on web:
#[allow(clippy::manual_assert)]
#[expect(clippy::manual_assert)]
if ui.button("panic!()").clicked() {
panic!("intentional panic!");
}

View File

@@ -10,7 +10,7 @@ pub use wrap_app::{Anchor, WrapApp};
/// Time of day as seconds since midnight. Used for clock in demo app.
pub(crate) fn seconds_since_midnight() -> f64 {
use chrono::Timelike;
use chrono::Timelike as _;
let time = chrono::Local::now().time();
time.num_seconds_from_midnight() as f64 + 1e-9 * (time.nanosecond() as f64)
}

View File

@@ -75,7 +75,7 @@ fn start_puffin_server() {
// We can store the server if we want, but in this case we just want
// it to keep running. Dropping it closes the server, so let's not drop it!
#[allow(clippy::mem_forget)]
#[expect(clippy::mem_forget)]
std::mem::forget(puffin_server);
}
Err(err) => {

View File

@@ -14,7 +14,7 @@ pub struct WebHandle {
#[wasm_bindgen]
impl WebHandle {
/// Installs a panic hook, then returns.
#[allow(clippy::new_without_default)]
#[allow(clippy::new_without_default, clippy::allow_attributes)]
#[wasm_bindgen(constructor)]
pub fn new() -> Self {
// Redirect [`log`] message to `console.log` and friends:

View File

@@ -188,7 +188,7 @@ impl WrapApp {
// This gives us image support:
egui_extras::install_image_loaders(&cc.egui_ctx);
#[allow(unused_mut)]
#[allow(unused_mut, clippy::allow_attributes)]
let mut slf = Self {
state: State::default(),