Removed old packages, fixed clippy warnings

This commit is contained in:
torbjornmolin
2025-09-28 18:59:06 +02:00
parent eb4a06b669
commit 6efc9e104c
3 changed files with 3 additions and 10 deletions

2
Cargo.lock generated
View File

@@ -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",

View File

@@ -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"

View File

@@ -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<u8>)> {
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<u8>)> {
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