From 6efc9e104c54102ef8244cd3906c307f93d6c8c8 Mon Sep 17 00:00:00 2001 From: torbjornmolin <37022228+torbjornmolin@users.noreply.github.com> Date: Sun, 28 Sep 2025 18:59:06 +0200 Subject: [PATCH] Removed old packages, fixed clippy warnings --- Cargo.lock | 2 -- Cargo.toml | 2 -- src/main.rs | 9 +++------ 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1897204..6a439ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -806,12 +806,10 @@ name = "image-placeholder-generator" version = "0.1.0" dependencies = [ "axum", - "bytes", "image", "serde", "text-to-png", "tokio", - "tokio-util", "tower-http", "tracing-subscriber", "zip", diff --git a/Cargo.toml b/Cargo.toml index 8f5e5d0..55f521b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,12 +5,10 @@ edition = "2024" [dependencies] axum = "0.8.4" -bytes = "1" image = "0.25.8" serde = { version = "1.0.227", features = ["derive"] } text-to-png = "0.2.0" tokio = { version = "1.47.1", features = ["fs", "rt-multi-thread"] } -tokio-util = { version = "0.7.16", features = ["io"] } tower-http = { version = "0.6.6", features = ["fs", "trace"] } tracing-subscriber = "0.3.20" zip = "5.1.1" diff --git a/src/main.rs b/src/main.rs index f6dfce5..77129d4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,7 @@ use axum::{ http::{Response, StatusCode, header}, routing::post, }; -use image::{GenericImage, GenericImageView}; +use image::GenericImage; use serde::Deserialize; use std::io::{Cursor, Write}; use tower_http::services::ServeFile; @@ -78,7 +78,7 @@ fn get_files(options: GenerateOptions) -> Vec<(String, Vec)> { for f in options.filenames { let mut imgbuf = image::ImageBuffer::new(options.width, options.height); - for (x, y, pixel) in imgbuf.enumerate_pixels_mut() { + for (_x, _y, pixel) in imgbuf.enumerate_pixels_mut() { *pixel = image::Rgba([190, 190, 190, 255]); } @@ -103,10 +103,7 @@ fn get_files(options: GenerateOptions) -> Vec<(String, Vec)> { let mut buf = Cursor::new(Vec::new()); imgbuf.write_to(&mut buf, image::ImageFormat::Png).unwrap(); - files.push(( - String::from(format!("{}.{}", f, image_file_ending)), - buf.into_inner(), - )); + files.push((format!("{}.{}", f, image_file_ending), buf.into_inner())); } files