mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 22:53:14 -04:00
Replace #[allow attributes with expect (#7796)
We do have `clippy::allow_attributes` turned on, but it doesn't seem to work properly
This commit is contained in:
@@ -142,7 +142,6 @@
|
||||
//!
|
||||
|
||||
#![warn(missing_docs)] // let's keep eframe well-documented
|
||||
#![allow(clippy::needless_doctest_main)]
|
||||
|
||||
// Limitation imposed by `accesskit_winit`:
|
||||
// https://github.com/AccessKit/accesskit/tree/accesskit-v0.18.0/platforms/winit#android-activity-compatibility`
|
||||
@@ -253,7 +252,7 @@ pub mod icon_data;
|
||||
/// This function can fail if we fail to set up a graphics context.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(any(feature = "glow", feature = "wgpu_no_default_features"))]
|
||||
#[allow(clippy::needless_pass_by_value, clippy::allow_attributes)]
|
||||
#[allow(clippy::allow_attributes, clippy::needless_pass_by_value)]
|
||||
pub fn run_native(
|
||||
app_name: &str,
|
||||
mut native_options: NativeOptions,
|
||||
|
||||
@@ -47,7 +47,7 @@ enum AppIconStatus {
|
||||
NotSetTryAgain,
|
||||
|
||||
/// We successfully set the icon and it should be visible now.
|
||||
#[allow(dead_code, clippy::allow_attributes)] // Not used on Linux
|
||||
#[allow(clippy::allow_attributes, dead_code)] // Not used on Linux
|
||||
Set,
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ fn set_title_and_icon(_title: &str, _icon_data: Option<&IconData>) -> AppIconSta
|
||||
#[cfg(target_os = "macos")]
|
||||
return set_title_and_icon_mac(_title, _icon_data);
|
||||
|
||||
#[allow(unreachable_code, clippy::allow_attributes)]
|
||||
#[allow(clippy::allow_attributes, unreachable_code)]
|
||||
AppIconStatus::NotSetIgnored
|
||||
}
|
||||
|
||||
|
||||
@@ -349,8 +349,6 @@ pub fn run_glow(
|
||||
mut native_options: epi::NativeOptions,
|
||||
app_creator: epi::AppCreator<'_>,
|
||||
) -> Result {
|
||||
#![allow(clippy::needless_return_with_question_mark)] // False positive
|
||||
|
||||
use super::glow_integration::GlowWinitApp;
|
||||
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
@@ -387,8 +385,6 @@ pub fn run_wgpu(
|
||||
mut native_options: epi::NativeOptions,
|
||||
app_creator: epi::AppCreator<'_>,
|
||||
) -> Result {
|
||||
#![allow(clippy::needless_return_with_question_mark)] // False positive
|
||||
|
||||
use super::wgpu_integration::WgpuWinitApp;
|
||||
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
|
||||
@@ -256,7 +256,7 @@ impl<'app> WgpuWinitApp<'app> {
|
||||
});
|
||||
}
|
||||
|
||||
#[allow(unused_mut, clippy::allow_attributes)] // used for accesskit
|
||||
#[allow(clippy::allow_attributes, unused_mut)] // used for accesskit
|
||||
let mut egui_winit = egui_winit::State::new(
|
||||
egui_ctx.clone(),
|
||||
ViewportId::ROOT,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#![allow(dead_code)] // not everything is used on wasm
|
||||
#![allow(clippy::allow_attributes, dead_code)] // not used on all platforms
|
||||
|
||||
use web_time::Instant;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ use crate::{App, epi, web::web_painter::WebPainter};
|
||||
use super::{NeedRepaint, now_sec, text_agent::TextAgent};
|
||||
|
||||
pub struct AppRunner {
|
||||
#[allow(dead_code, clippy::allow_attributes)]
|
||||
#[allow(clippy::allow_attributes, dead_code)]
|
||||
pub(crate) web_options: crate::WebOptions,
|
||||
pub(crate) frame: epi::Frame,
|
||||
egui_ctx: egui::Context,
|
||||
|
||||
@@ -38,7 +38,7 @@ impl log::Log for WebLogger {
|
||||
}
|
||||
|
||||
fn log(&self, record: &log::Record<'_>) {
|
||||
#![allow(clippy::match_same_arms)]
|
||||
#![expect(clippy::match_same_arms)]
|
||||
|
||||
if !self.enabled(record.metadata()) {
|
||||
return;
|
||||
@@ -110,7 +110,7 @@ mod console {
|
||||
/// * `tokio-1.24.1/src/runtime/runtime.rs`
|
||||
/// * `rerun/src/main.rs`
|
||||
/// * `core/src/ops/function.rs`
|
||||
#[allow(dead_code, clippy::allow_attributes)] // only used on web and in tests
|
||||
#[allow(clippy::allow_attributes, dead_code)] // only used on web and in tests
|
||||
fn shorten_file_path(file_path: &str) -> &str {
|
||||
if let Some(i) = file_path.rfind("/src/") {
|
||||
if let Some(prev_slash) = file_path[..i].rfind('/') {
|
||||
|
||||
@@ -28,7 +28,7 @@ impl WebPainterGlow {
|
||||
let (gl, shader_prefix) =
|
||||
init_glow_context_from_canvas(&canvas, options.webgl_context_option)?;
|
||||
|
||||
#[allow(clippy::arc_with_non_send_sync, clippy::allow_attributes)] // For wasm
|
||||
#[allow(clippy::allow_attributes, clippy::arc_with_non_send_sync)] // For wasm
|
||||
let gl = std::sync::Arc::new(gl);
|
||||
|
||||
let painter = egui_glow::Painter::new(gl, shader_prefix, None, options.dithering)
|
||||
|
||||
Reference in New Issue
Block a user