mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 14:50:03 -04:00
Enable more clippy lints (#6853)
* Follows https://github.com/emilk/egui/pull/6848
This commit is contained in:
@@ -339,6 +339,7 @@ pub fn image_snapshot_options(current: &image::RgbaImage, name: &str, options: &
|
||||
}
|
||||
|
||||
/// Image snapshot test.
|
||||
///
|
||||
/// The snapshot will be saved under `tests/snapshots/{name}.png`.
|
||||
/// The new image from the last test run will be saved under `tests/snapshots/{name}.new.png`.
|
||||
/// If the new image didn't match the snapshot, a diff image will be saved under `tests/snapshots/{name}.diff.png`.
|
||||
@@ -451,7 +452,7 @@ impl<State> Harness<'_, State> {
|
||||
|
||||
// Deprecated wgpu_snapshot functions
|
||||
// TODO(lucasmerlin): Remove in 0.32
|
||||
#[allow(clippy::missing_errors_doc)]
|
||||
#[expect(clippy::missing_errors_doc)]
|
||||
#[cfg(feature = "wgpu")]
|
||||
impl<State> Harness<'_, State> {
|
||||
#[deprecated(
|
||||
@@ -552,7 +553,7 @@ impl SnapshotResults {
|
||||
}
|
||||
|
||||
/// Convert this into a `Result<(), Self>`.
|
||||
#[allow(clippy::missing_errors_doc)]
|
||||
#[expect(clippy::missing_errors_doc)]
|
||||
pub fn into_result(self) -> Result<(), Self> {
|
||||
if self.has_errors() {
|
||||
Err(self)
|
||||
@@ -566,7 +567,7 @@ impl SnapshotResults {
|
||||
}
|
||||
|
||||
/// Panics if there are any errors, displaying each.
|
||||
#[allow(clippy::unused_self)]
|
||||
#[expect(clippy::unused_self)]
|
||||
#[track_caller]
|
||||
pub fn unwrap(self) {
|
||||
// Panic is handled in drop
|
||||
@@ -586,7 +587,7 @@ impl Drop for SnapshotResults {
|
||||
if std::thread::panicking() {
|
||||
return;
|
||||
}
|
||||
#[allow(clippy::manual_assert)]
|
||||
#[expect(clippy::manual_assert)]
|
||||
if self.has_errors() {
|
||||
panic!("{}", self);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use egui::containers::menu::{Bar, MenuConfig, SubMenuButton};
|
||||
use egui::{include_image, PopupCloseBehavior, Ui};
|
||||
use egui_kittest::{Harness, SnapshotResults};
|
||||
use kittest::Queryable;
|
||||
use kittest::Queryable as _;
|
||||
|
||||
struct TestMenu {
|
||||
config: MenuConfig,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use kittest::Queryable;
|
||||
use kittest::Queryable as _;
|
||||
|
||||
#[test]
|
||||
fn test_interactive_tooltip() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use egui::accesskit::Role;
|
||||
use egui::{Button, ComboBox, Image, Vec2, Widget};
|
||||
use egui_kittest::{kittest::Queryable, Harness, SnapshotResults};
|
||||
use egui::{Button, ComboBox, Image, Vec2, Widget as _};
|
||||
use egui_kittest::{kittest::Queryable as _, Harness, SnapshotResults};
|
||||
|
||||
#[test]
|
||||
pub fn focus_should_skip_over_disabled_buttons() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use egui::Modifiers;
|
||||
use egui_kittest::Harness;
|
||||
use kittest::{Key, Queryable};
|
||||
use kittest::{Key, Queryable as _};
|
||||
|
||||
#[test]
|
||||
fn test_shrink() {
|
||||
|
||||
Reference in New Issue
Block a user