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

Enable more clippy lints (#7418)

More is more!
This commit is contained in:
Emil Ernerfeldt
2025-08-05 19:47:26 +02:00
committed by GitHub
parent e9afd3c52d
commit ef039aa566
13 changed files with 38 additions and 16 deletions

View File

@@ -468,6 +468,8 @@ fn should_prioritize_hits_on_back(back: Rect, front: Rect) -> bool {
#[cfg(test)]
mod tests {
#![expect(clippy::print_stdout)]
use emath::{Rect, pos2, vec2};
use crate::{Id, Sense};

View File

@@ -648,6 +648,8 @@ impl ViewportBuilder {
/// returning a list of commands and a bool indicating if the window needs to be recreated.
#[must_use]
pub fn patch(&mut self, new_vp_builder: Self) -> (Vec<ViewportCommand>, bool) {
#![expect(clippy::useless_let_if_seq)] // False positive
let Self {
title: new_title,
app_id: new_app_id,

View File

@@ -422,10 +422,12 @@ impl RichText {
font_id
};
let mut background_color = background_color;
if code {
background_color = style.visuals.code_bg_color;
}
let background_color = if code {
style.visuals.code_bg_color
} else {
background_color
};
let underline = if underline {
crate::Stroke::new(1.0, line_color)
} else {

View File

@@ -938,11 +938,9 @@ fn animated_image_frame_index(ctx: &Context, uri: &str) -> usize {
return index;
}
}
0
} else {
0
}
0
}
/// Checks if uri is a gif file

View File

@@ -929,12 +929,10 @@ fn events(
event if cursor_range.on_event(os, event, galley, id) => None,
Event::Copy => {
if cursor_range.is_empty() {
None
} else {
if !cursor_range.is_empty() {
copy_if_not_password(ui, cursor_range.slice_str(text.as_str()).to_owned());
None
}
None
}
Event::Cut => {
if cursor_range.is_empty() {