Skip to content

Commit 001fe7a

Browse files
committed
chore(clippy): statisfy clippy
1 parent 4529304 commit 001fe7a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/linux/x11_api.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,9 @@ mod test {
321321
let (width_new, height_new) = image_calibrated.dimensions();
322322
dbg!(width, width_new, height, height_new);
323323

324-
let Bgra([_, _, _, a]) = image.get_pixel(width / 2, 0);
325-
dbg!(a);
326-
if a == 0 {
324+
let Bgra([_, _, _, alpha]) = image.get_pixel(width / 2, 0);
325+
dbg!(alpha);
326+
if alpha == 0 {
327327
// if that pixel was full transparent, for example on ubuntu / GNOME, caused by the drop shadow
328328
// then we expect the calibrated image to be smaller and cropped by this area
329329
assert!(api.margin.is_some());
@@ -379,13 +379,13 @@ mod test {
379379
let win = api.get_active_window()?;
380380
let image_raw = api.capture_window_screenshot(win)?;
381381
let image: View<_, Bgra<u8>> = image_raw.as_view().unwrap();
382-
let (w, h) = image.dimensions();
382+
let (width, height) = image.dimensions();
383383

384-
let Bgra([b, g, r, a]) = image.get_pixel(w / 2, h / 2);
385-
assert_ne!(b, 0);
386-
assert_ne!(g, 0);
387-
assert_ne!(r, 0);
388-
assert_ne!(a, 0, "alpha is unexpected");
384+
let Bgra([blue, green, red, alpha]) = image.get_pixel(width / 2, height / 2);
385+
assert_ne!(blue, 0);
386+
assert_ne!(green, 0);
387+
assert_ne!(red, 0);
388+
assert_ne!(alpha, 0, "alpha is unexpected");
389389

390390
// Note: visual validation is sometimes helpful:
391391
// let file = format!("frame-{}.tga", win);

0 commit comments

Comments
 (0)