srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/crates/wayland/src/udev
diff options
context:
space:
mode:
authorsrdusr <[email protected]>2025-02-18 21:15:00 +0200
committersrdusr <[email protected]>2025-02-18 21:15:00 +0200
commit681a023b04b513b3283d85fe157d6b38987bc42e (patch)
tree36501b0c6323039acb9ec7d85a6faccf1cc8c883 /crates/wayland/src/udev
parent78d889c48e5b1336c73f28a2e2d5c8a571c7dd43 (diff)
downloadsrdwm-681a023b04b513b3283d85fe157d6b38987bc42e.tar.gz
srdwm-681a023b04b513b3283d85fe157d6b38987bc42e.zip
Fix clippy warnings surfaced by the merge
Pre-existing issues in the uncommitted rust-rewrite work (unused imports, over-arity glyph-drawing functions, a couple of complex inline types, or_insert_with(T::default) instead of or_default(), and one unsimplified test-only arithmetic expression), plus two imports left unused by switching to or_default(). None of these are behavior changes. Full workspace build + clippy -D warnings + test suite (378 tests) all green after this.
Diffstat (limited to 'crates/wayland/src/udev')
-rw-r--r--crates/wayland/src/udev/mod.rs3
-rw-r--r--crates/wayland/src/udev/render.rs3
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/wayland/src/udev/mod.rs b/crates/wayland/src/udev/mod.rs
index ae0bd7f..83ffa87 100644
--- a/crates/wayland/src/udev/mod.rs
+++ b/crates/wayland/src/udev/mod.rs
@@ -40,7 +40,6 @@ use smithay::backend::input::{
use smithay::backend::libinput::{LibinputInputBackend, LibinputSessionInterface};
use smithay::backend::renderer::damage::OutputDamageTracker;
use smithay::backend::renderer::element::memory::MemoryRenderBufferRenderElement;
-use smithay::backend::renderer::element::solid::SolidColorBuffer;
use smithay::backend::renderer::element::Kind;
use smithay::backend::renderer::pixman::PixmanRenderer;
use smithay::backend::renderer::{Bind, ImportDma};
@@ -474,7 +473,7 @@ mod copy_damaged_rows_tests {
let mut dst = vec![0u8; w * h * 4];
// Only the single pixel at (1, 1).
copy_damaged_rows(&src, &mut dst, w * 4, w * 4, w, h, &[rect(1, 1, 1, 1)]);
- let idx = (1 * w + 1) * 4;
+ let idx = (w + 1) * 4;
assert_eq!(dst[idx], src[idx], "the damaged pixel must be copied");
assert_eq!(dst[0], 0, "a pixel outside the damage rect must stay untouched");
assert_eq!(dst[dst.len() - 4], 0, "the last row's pixel is also outside the rect and must stay untouched");
diff --git a/crates/wayland/src/udev/render.rs b/crates/wayland/src/udev/render.rs
index 3a62292..bbabc40 100644
--- a/crates/wayland/src/udev/render.rs
+++ b/crates/wayland/src/udev/render.rs
@@ -154,6 +154,7 @@ impl CompState {
// frame-callback loop below (after `udev` is no longer borrowed)
// can notify only the windows that damage actually overlapped --
// see `windows_touched_by_damage`'s doc comment in elements.rs.
+ #[allow(clippy::type_complexity)]
let mut presented: Vec<(Output, Point<i32, Logical>, Vec<Rectangle<i32, Physical>>)> = Vec::new();
for (index, output) in ready {
let lock_surface = self.lock_surface_for(&output).cloned();
@@ -193,7 +194,7 @@ impl CompState {
// pointer itself. See `color_filter::render_element` for
// why an overlay rather than a true per-pixel shader.
let color_filter = self.wm.borrow().color_filter;
- let buf = self.color_filter_buffers.entry(output.name()).or_insert_with(SolidColorBuffer::default);
+ let buf = self.color_filter_buffers.entry(output.name()).or_default();
if let Some(elem) = crate::color_filter::render_element(buf, color_filter, hsize) {
custom_elements.push(crate::elements::OverlayElement::Solid(elem));
}