From 2115a27e39d6b2e659af6ce269ab26b8b334da46 Mon Sep 17 00:00:00 2001 From: saji Date: Fri, 2 Aug 2024 18:52:27 -0500 Subject: [PATCH] linting fixes --- benches/dithering.rs | 2 +- src/main.rs | 7 ++++--- test.hurl | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/benches/dithering.rs b/benches/dithering.rs index 1e1f976..aad6061 100644 --- a/benches/dithering.rs +++ b/benches/dithering.rs @@ -1,4 +1,4 @@ -use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion}; +use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion}; use image::{ImageReader, RgbImage}; use pi_frame_server::dither::{DitherMethod, DitheredImage}; use pi_frame_server::eink::Palette; diff --git a/src/main.rs b/src/main.rs index ca29fed..42912cb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,21 +4,22 @@ pub mod dither; pub mod eink; use serde::Deserialize; +use tower_http::trace::TraceLayer; use std::path::PathBuf; -use toml; use crate::display::get_display; use crate::dither::{DitherMethod, DitheredImage}; use crate::eink::Palette; use clap::{Args, Parser, Subcommand}; use image::RgbImage; -use tracing::{error, event, info, instrument, warn, Level}; +use tracing::{error, info}; /// Application config, including sqlite db path, scan folders, and scheduling. #[derive(Deserialize, Debug)] struct Config { database_path: PathBuf, search_paths: Vec, + host: String, } /// Display images on E-Ink Displays @@ -85,7 +86,7 @@ async fn main() -> anyhow::Result<()> { let display = get_display(); let ctx = api::AppState::new(display); - let app = api::router().with_state(ctx); + let app = api::router().with_state(ctx).layer(TraceLayer::new_for_http()); let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await?; info!("Listening on 0.0.0.0:3000"); axum::serve(listener, app).await?; diff --git a/test.hurl b/test.hurl index efd58a1..981cd0f 100644 --- a/test.hurl +++ b/test.hurl @@ -1,4 +1,4 @@ -POST http://192.168.0.185:3000/setimage +POST http://localhost:3000/setimage [MultipartFormData] image: file,{{image}}; dither_method: Atkinson