1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 14:49:06 -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

@@ -106,7 +106,7 @@ impl RotatingTriangle {
let program = gl.create_program().expect("Cannot create program");
let (vertex_shader_source, fragment_shader_source) = (
r#"
"
const vec2 verts[3] = vec2[3](
vec2(0.0, 1.0),
vec2(-1.0, -1.0),
@@ -124,15 +124,15 @@ impl RotatingTriangle {
gl_Position = vec4(verts[gl_VertexID], 0.0, 1.0);
gl_Position.x *= cos(u_angle);
}
"#,
r#"
",
"
precision mediump float;
in vec4 v_color;
out vec4 out_color;
void main() {
out_color = v_color;
}
"#,
",
);
let shader_sources = [

View File

@@ -64,7 +64,8 @@ impl eframe::App for MyApp {
additional_info.push(format!("{} bytes", bytes.len()));
}
if !additional_info.is_empty() {
info += &format!(" ({})", additional_info.join(", "));
use std::fmt::Write as _;
write!(info, " ({})", additional_info.join(", ")).ok();
}
ui.label(info);