Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crates/ecolor/src/hsva.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl Hsva {
/// From linear RGBA with premultiplied alpha
#[inline]
pub fn from_rgba_premultiplied(r: f32, g: f32, b: f32, a: f32) -> Self {
#![allow(clippy::many_single_char_names)]
#![expect(clippy::many_single_char_names)]
if a <= 0.0 {
if r == 0.0 && b == 0.0 && a == 0.0 {
Self::default()
Expand All @@ -57,7 +57,7 @@ impl Hsva {
/// From linear RGBA without premultiplied alpha
#[inline]
pub fn from_rgba_unmultiplied(r: f32, g: f32, b: f32, a: f32) -> Self {
#![allow(clippy::many_single_char_names)]
#![expect(clippy::many_single_char_names)]
let (h, s, v) = hsv_from_rgb([r, g, b]);
Self { h, s, v, a }
}
Expand Down Expand Up @@ -189,7 +189,7 @@ impl From<Color32> for Hsva {
/// All ranges in 0-1, rgb is linear.
#[inline]
pub fn hsv_from_rgb([r, g, b]: [f32; 3]) -> (f32, f32, f32) {
#![allow(clippy::many_single_char_names)]
#![expect(clippy::many_single_char_names)]
let min = r.min(g.min(b));
let max = r.max(g.max(b)); // value

Expand All @@ -213,7 +213,7 @@ pub fn hsv_from_rgb([r, g, b]: [f32; 3]) -> (f32, f32, f32) {
/// All ranges in 0-1, rgb is linear.
#[inline]
pub fn rgb_from_hsv((h, s, v): (f32, f32, f32)) -> [f32; 3] {
#![allow(clippy::many_single_char_names)]
#![expect(clippy::many_single_char_names)]
let h = (h.fract() + 1.0).fract(); // wrap
let s = s.clamp(0.0, 1.0);

Expand Down
2 changes: 1 addition & 1 deletion crates/ecolor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
//!

#![allow(clippy::wrong_self_convention)]
#![expect(clippy::wrong_self_convention)]

#[cfg(feature = "cint")]
mod cint_impl;
Expand Down
3 changes: 1 addition & 2 deletions crates/eframe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions crates/eframe/src/native/app_icon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand All @@ -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
}

Expand Down
4 changes: 0 additions & 4 deletions crates/eframe/src/native/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))]
Expand Down Expand Up @@ -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"))]
Expand Down
2 changes: 1 addition & 1 deletion crates/eframe/src/native/wgpu_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion crates/eframe/src/stopwatch.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
2 changes: 1 addition & 1 deletion crates/eframe/src/web/app_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions crates/eframe/src/web/web_logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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('/') {
Expand Down
2 changes: 1 addition & 1 deletion crates/eframe/src/web/web_painter_glow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions crates/egui-wgpu/src/capture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl CaptureState {
// It would be more efficient to reuse the Buffer, e.g. via some kind of ring buffer, but
// for most screenshot use cases this should be fine. When taking many screenshots (e.g. for a video)
// it might make sense to revisit this and implement a more efficient solution.
#[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 buffer = device.create_buffer(&wgpu::BufferDescriptor {
label: Some("egui_screen_capture_buffer"),
size: (self.padding.padded_bytes_per_row * self.texture.height()) as u64,
Expand Down Expand Up @@ -186,7 +186,7 @@ impl CaptureState {
tx: CaptureSender,
viewport_id: ViewportId,
) {
#[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 buffer = Arc::new(buffer);
let buffer_clone = Arc::clone(&buffer);
let buffer_slice = buffer_clone.slice(..);
Expand Down
4 changes: 1 addition & 3 deletions crates/egui-wgpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
#![doc = document_features::document_features!()]
//!

#![allow(unsafe_code)]

pub use wgpu;

/// Low-level painting of [`egui`](https://github.com/emilk/egui) on [`wgpu`].
Expand Down Expand Up @@ -247,7 +245,7 @@ impl RenderState {

// On wasm, depending on feature flags, wgpu objects may or may not implement sync.
// It doesn't make sense to switch to Rc for that special usecase, so simply disable the lint.
#[allow(clippy::arc_with_non_send_sync, clippy::allow_attributes)] // For wasm
#[allow(clippy::allow_attributes, clippy::arc_with_non_send_sync)] // For wasm
Ok(Self {
adapter,
#[cfg(not(target_arch = "wasm32"))]
Expand Down
2 changes: 1 addition & 1 deletion crates/egui-wgpu/src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl WgpuSetup {
pub async fn new_instance(&self) -> wgpu::Instance {
match self {
Self::CreateNew(create_new) => {
#[allow(unused_mut, clippy::allow_attributes)]
#[allow(clippy::allow_attributes, unused_mut)]
let mut backends = create_new.instance_descriptor.backends;

// Don't try WebGPU if we're not in a secure context.
Expand Down
1 change: 1 addition & 0 deletions crates/egui-wgpu/src/winit.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![expect(clippy::missing_errors_doc)]
#![expect(clippy::undocumented_unsafe_blocks)]
#![expect(clippy::unwrap_used)] // TODO(emilk): avoid unwraps
#![expect(unsafe_code)]

use crate::{RenderState, SurfaceErrorAction, WgpuConfiguration, renderer};
use crate::{
Expand Down
2 changes: 1 addition & 1 deletion crates/egui-winit/src/clipboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ fn init_arboard() -> Option<arboard::Clipboard> {
fn init_smithay_clipboard(
raw_display_handle: Option<RawDisplayHandle>,
) -> Option<smithay_clipboard::Clipboard> {
#![allow(clippy::undocumented_unsafe_blocks)]
#![expect(clippy::undocumented_unsafe_blocks)]

profiling::function_scope!();

Expand Down
2 changes: 1 addition & 1 deletion crates/egui-winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
//!

#![allow(clippy::manual_range_contains)]
#![expect(clippy::manual_range_contains)]

#[cfg(feature = "accesskit")]
pub use accesskit_winit;
Expand Down
2 changes: 1 addition & 1 deletion crates/egui-winit/src/safe_area.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ mod ios {

let app = UIApplication::sharedApplication(main_thread_marker);

#[allow(unsafe_code)]
#[expect(unsafe_code)]
unsafe {
// Look for the first window scene that's in the foreground
for scene in app.connectedScenes() {
Expand Down
3 changes: 1 addition & 2 deletions crates/egui/src/atomics/atoms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,7 @@ macro_rules! all_the_atoms {
$($T: IntoAtoms<'a>),*
{
fn collect(self, _atoms: &mut Atoms<'a>) {
#[allow(clippy::allow_attributes)]
#[allow(non_snake_case)]
#[allow(clippy::allow_attributes, non_snake_case)]
let ($($T),*) = self;
$($T.collect(_atoms);)*
}
Expand Down
2 changes: 1 addition & 1 deletion crates/egui/src/containers/old_popup.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Old and deprecated API for popups. Use [`Popup`] instead.
#![allow(deprecated)]
#![expect(deprecated)]

use crate::containers::tooltip::Tooltip;
use crate::{
Expand Down
2 changes: 1 addition & 1 deletion crates/egui/src/containers/scroll_area.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! See [`ScrollArea`] for docs.

#![allow(clippy::needless_range_loop)]
#![expect(clippy::needless_range_loop)]

use std::ops::{Add, AddAssign, BitOr, BitOrAssign};

Expand Down
2 changes: 1 addition & 1 deletion crates/egui/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,7 @@ impl Context {
self.check_for_id_clash(w.id, w.rect, "widget");
}

#[allow(clippy::let_and_return, clippy::allow_attributes)]
#[allow(clippy::allow_attributes, clippy::let_and_return)]
let res = self.get_response(w);

#[cfg(debug_assertions)]
Expand Down
2 changes: 1 addition & 1 deletion crates/egui/src/hit_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ fn contains_circle(interact_rect: emath::Rect, pos: Pos2, radius: f32) -> bool {
}

fn hit_test_on_close(close: &[WidgetRect], pos: Pos2) -> WidgetHits {
#![allow(clippy::collapsible_else_if)]
#![expect(clippy::collapsible_else_if)]

// First find the best direct hits:
let hit_click = find_closest_within(
Expand Down
4 changes: 2 additions & 2 deletions crates/egui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@
//! egui apps can run significantly (~20%) faster by using a custom allocator, like [mimalloc](https://crates.io/crates/mimalloc) or [talc](https://crates.io/crates/talc).
//!

#![allow(clippy::float_cmp)]
#![allow(clippy::manual_range_contains)]
#![expect(clippy::float_cmp)]
#![expect(clippy::manual_range_contains)]

mod animation_manager;
mod atomics;
Expand Down
2 changes: 1 addition & 1 deletion crates/egui/src/memory/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl Theme {
/// This is not the best design as it doesn't allow switching back to "follow system".
#[must_use]
pub(crate) fn small_toggle_button(self, ui: &mut crate::Ui) -> Option<Self> {
#![allow(clippy::collapsible_else_if)]
#![expect(clippy::collapsible_else_if)]
if self == Self::Dark {
if ui
.add(Button::new("☀").frame(false))
Expand Down
2 changes: 1 addition & 1 deletion crates/egui/src/menu.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(deprecated)]
#![expect(deprecated)]
//! Deprecated menu API - Use [`crate::containers::menu`] instead.
//!
//! Usage:
Expand Down
2 changes: 0 additions & 2 deletions crates/egui/src/style.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//! egui theme (spacing, colors, etc).

#![allow(clippy::if_same_then_else)]

use emath::Align;
use epaint::{AlphaFromCoverage, CornerRadius, Shadow, Stroke, TextOptions, text::FontTweak};
use std::{collections::BTreeMap, ops::RangeInclusive, sync::Arc};
Expand Down
2 changes: 1 addition & 1 deletion crates/egui/src/ui.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![warn(missing_docs)] // Let's keep `Ui` well-documented.
#![allow(clippy::use_self)]
#![expect(clippy::use_self)]

use std::{any::Any, hash::Hash, ops::Deref, sync::Arc};

Expand Down
4 changes: 2 additions & 2 deletions crates/egui/src/util/id_type_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ impl IdTypeMap {

/// For tests
#[cfg(feature = "persistence")]
#[allow(unused, clippy::allow_attributes)]
#[allow(clippy::allow_attributes, unused)]
fn get_generation<T: SerializableAny>(&self, id: Id) -> Option<usize> {
let element = self.map.get(&hash(TypeId::of::<T>(), id))?;
match element {
Expand Down Expand Up @@ -724,7 +724,7 @@ fn test_two_id_two_type() {

#[test]
fn test_two_id_x_two_types() {
#![allow(clippy::approx_constant)]
#![expect(clippy::approx_constant)]

let a = Id::new("a");
let b = Id::new("b");
Expand Down
2 changes: 1 addition & 1 deletion crates/egui/src/widgets/color_picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ fn color_button(ui: &mut Ui, color: Color32, open: bool) -> Response {
}

fn color_slider_1d(ui: &mut Ui, value: &mut f32, color_at: impl Fn(f32) -> Color32) -> Response {
#![allow(clippy::identity_op)]
#![expect(clippy::identity_op)]

let desired_size = vec2(ui.spacing().slider_width, ui.spacing().interact_size.y);
let (rect, response) = ui.allocate_at_least(desired_size, Sense::click_and_drag());
Expand Down
2 changes: 1 addition & 1 deletion crates/egui/src/widgets/drag_value.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(clippy::needless_pass_by_value)] // False positives with `impl ToString`
#![expect(clippy::needless_pass_by_value)] // False positives with `impl ToString`

use std::{cmp::Ordering, ops::RangeInclusive};

Expand Down
2 changes: 1 addition & 1 deletion crates/egui/src/widgets/slider.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(clippy::needless_pass_by_value)] // False positives with `impl ToString`
#![expect(clippy::needless_pass_by_value)] // False positives with `impl ToString`

use std::ops::RangeInclusive;

Expand Down
2 changes: 1 addition & 1 deletion crates/egui_demo_app/src/apps/custom3d_glow.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(clippy::undocumented_unsafe_blocks)]
#![expect(clippy::undocumented_unsafe_blocks)]

use std::sync::Arc;

Expand Down
4 changes: 2 additions & 2 deletions crates/egui_demo_app/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! Demo app for egui

#![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
#![allow(clippy::never_loop)] // False positive
#![expect(rustdoc::missing_crate_level_docs)] // it's an example
#![allow(clippy::allow_attributes, clippy::never_loop)]

#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; // Much faster allocator, can give 20% speedups: https://github.com/emilk/egui/pull/7029
Expand Down
4 changes: 1 addition & 3 deletions crates/egui_demo_app/src/web.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(clippy::mem_forget)] // False positives from #[wasm_bindgen] macro

use eframe::wasm_bindgen::{self, prelude::*};

use crate::WrapApp;
Expand All @@ -14,7 +12,7 @@ pub struct WebHandle {
#[wasm_bindgen]
impl WebHandle {
/// Installs a panic hook, then returns.
#[allow(clippy::new_without_default, clippy::allow_attributes)]
#[allow(clippy::allow_attributes, clippy::new_without_default)]
#[wasm_bindgen(constructor)]
pub fn new() -> Self {
// Redirect [`log`] message to `console.log` and friends:
Expand Down
2 changes: 1 addition & 1 deletion crates/egui_demo_app/src/wrap_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl WrapApp {
cc.egui_ctx
.add_plugin(crate::accessibility_inspector::AccessibilityInspectorPlugin::default());

#[allow(unused_mut, clippy::allow_attributes)]
#[allow(clippy::allow_attributes, unused_mut)]
let mut slf = Self {
state: State::default(),

Expand Down
Loading
Loading