1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00

Enable a few more clippy lints (#8064)

Enable these new clippy lints and fix all warnings:

* `format_push_string` — use `write!` instead of `s += &format!(…)` to
avoid extra allocations
* `ignored_unit_patterns` — use `()` instead of `_` when matching unit
* `missing_fields_in_debug` — ensure manual `Debug` impls account for
all fields
* `needless_raw_string_hashes` — remove unnecessary `r#` on string
literals
* `ref_option` — prefer `Option<&T>` over `&Option<T>` in function
signatures
This commit is contained in:
Emil Ernerfeldt
2026-04-04 16:20:29 +02:00
committed by GitHub
parent 8ada641ee2
commit 4a09782fce
17 changed files with 100 additions and 53 deletions

View File

@@ -563,7 +563,7 @@ pub fn image_snapshot_options(
options: &SnapshotOptions,
) {
match try_image_snapshot_options(current, name, options) {
Ok(_) => {}
Ok(()) => {}
Err(err) => {
panic!("{err}");
}
@@ -582,7 +582,7 @@ pub fn image_snapshot_options(
#[track_caller]
pub fn image_snapshot(current: &image::RgbaImage, name: impl Into<String>) {
match try_image_snapshot(current, name) {
Ok(_) => {}
Ok(()) => {}
Err(err) => {
panic!("{err}");
}
@@ -884,14 +884,14 @@ impl Drop for SnapshotResults {
#[expect(clippy::manual_assert)]
if count >= 2 {
panic!(
r#"
"
Multiple SnapshotResults were dropped without being handled.
In order to allow consistent snapshot updates, all snapshot results within a test should be merged in a single SnapshotResults instance.
Usually this is handled internally in a harness. If you have multiple harnesses, you can merge the results using `Harness::take_snapshot_results` and `SnapshotResults::extend`.
The SnapshotResult was constructed at {}
"#,
",
self.location
);
}