From c05d987ff1e6bcd055e41da5af1ce522424091eb Mon Sep 17 00:00:00 2001 From: Jory Severijnse Date: Tue, 17 Mar 2026 20:51:14 +0100 Subject: [PATCH] fix(ci): update depgraph argument and formatting - metrics.yml: use correct --dedup-transitive-deps flag - render.rs: apply cargo fmt fixes --- .github/workflows/metrics.yml | 2 +- src/render.rs | 43 +++++++++++++++++------------------ 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/.github/workflows/metrics.yml b/.github/workflows/metrics.yml index ec839ce..1f58f5c 100644 --- a/.github/workflows/metrics.yml +++ b/.github/workflows/metrics.yml @@ -57,7 +57,7 @@ jobs: - name: Generate dependency graph run: | cargo install cargo-depgraph - cargo depgraph --all-features --dedup-transitive --format dot > deps.dot + cargo depgraph --all-features --dedup-transitive-deps --format dot > deps.dot echo "Dependency graph generated: deps.dot" echo "Total dependencies: $(cargo tree --depth 0 | wc -l)" diff --git a/src/render.rs b/src/render.rs index a25e213..04c6a6a 100644 --- a/src/render.rs +++ b/src/render.rs @@ -499,33 +499,32 @@ impl Renderer { let art_size = 56.0; let spacing = 80.0; - if self.config.show_album_art - && self.system_status.media_art_url != self.last_art_url { - self.last_art_url = self.system_status.media_art_url.clone(); - self.media_art_surface = None; - if let Some(ref data) = self.system_status.media_art_data { - if let Ok(img) = image::load_from_memory(data) { - let img = img.to_rgba8(); - let (w, h) = img.dimensions(); - let mut surface = - ImageSurface::create(Format::ARgb32, w as i32, h as i32).unwrap(); - { - let mut surface_data = surface.data().unwrap(); - for y in 0..h { - for x in 0..w { - let pixel = img.get_pixel(x, y); - let idx = ((y * w + x) * 4) as usize; - surface_data[idx] = pixel[2]; - surface_data[idx + 1] = pixel[1]; - surface_data[idx + 2] = pixel[0]; - surface_data[idx + 3] = pixel[3]; - } + if self.config.show_album_art && self.system_status.media_art_url != self.last_art_url { + self.last_art_url = self.system_status.media_art_url.clone(); + self.media_art_surface = None; + if let Some(ref data) = self.system_status.media_art_data { + if let Ok(img) = image::load_from_memory(data) { + let img = img.to_rgba8(); + let (w, h) = img.dimensions(); + let mut surface = + ImageSurface::create(Format::ARgb32, w as i32, h as i32).unwrap(); + { + let mut surface_data = surface.data().unwrap(); + for y in 0..h { + for x in 0..w { + let pixel = img.get_pixel(x, y); + let idx = ((y * w + x) * 4) as usize; + surface_data[idx] = pixel[2]; + surface_data[idx + 1] = pixel[1]; + surface_data[idx + 2] = pixel[0]; + surface_data[idx + 3] = pixel[3]; } } - self.media_art_surface = Some(surface); } + self.media_art_surface = Some(surface); } } + } let has_art = self.config.show_album_art && self.media_art_surface.is_some(); let text_x = if has_art {