commit 546914033252edaf383fab9c10dfcceac1466560
parent 242317a915c373547a68f0711b215038edb5f8ed
Author: kernelkind <kernelkind@gmail.com>
Date: Fri, 3 Oct 2025 16:14:15 -0400
add clippy rule to disallow the usage of `load_texture`
Signed-off-by: kernelkind <kernelkind@gmail.com>
Diffstat:
3 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/crates/notedeck/Clippy.toml b/crates/notedeck/Clippy.toml
@@ -0,0 +1,3 @@
+disallowed-methods = [
+ { path = "egui::Context::load_texture", reason = "Use load_texture_checked" }
+]
+\ No newline at end of file
diff --git a/crates/notedeck/src/lib.rs b/crates/notedeck/src/lib.rs
@@ -1,3 +1,5 @@
+#![deny(clippy::disallowed_methods)]
+
pub mod abbrev;
mod account;
mod app;
diff --git a/crates/notedeck/src/media/mod.rs b/crates/notedeck/src/media/mod.rs
@@ -47,5 +47,6 @@ pub fn load_texture_checked(
panic!("The image MUST be less than or equal to {MAX_SIZE_WGPU} pixels in each direction");
}
+ #[allow(clippy::disallowed_methods, reason = "centralized safe wrapper")]
ctx.load_texture(name, image, options)
}