diff --git a/src/api.rs b/src/api.rs index ecc8b3f..fc7a77d 100644 --- a/src/api.rs +++ b/src/api.rs @@ -3,10 +3,10 @@ use axum::extract::Multipart; use axum::http::StatusCode; use axum::response::IntoResponse; use axum::{extract::State, response::Response, routing::post, Router}; -use image::{ImageReader, RgbImage}; +use image::ImageReader; use std::io::Cursor; use std::time::Duration; -use tracing::{error, info, debug, instrument}; +use tracing::{debug, error, info, instrument}; use crate::display::EInkPanel; use std::sync::Arc; @@ -36,7 +36,6 @@ impl Context { } } - #[derive(Debug)] pub struct DisplaySetCommand { img: Box, @@ -107,10 +106,10 @@ async fn set_image( let mut buf = EInkImage::new(800, 480); let dither = ErrorDiffusionDither::new(DiffusionMatrix::Atkinson); dither.dither(&image.into(), &mut buf); - let cmd = DisplaySetCommand { - img: Box::new(buf), - }; - ctx.display_channel.send_timeout(cmd, Duration::from_secs(10)).await?; + let cmd = DisplaySetCommand { img: Box::new(buf) }; + ctx.display_channel + .send_timeout(cmd, Duration::from_secs(10)) + .await?; } } Ok(()) diff --git a/src/display.rs b/src/display.rs index bb842cd..0a12350 100644 --- a/src/display.rs +++ b/src/display.rs @@ -3,7 +3,7 @@ use linux_embedded_hal::spidev::SpiModeFlags; use linux_embedded_hal::spidev::SpidevOptions; use linux_embedded_hal::{CdevPin, Delay, SpidevDevice}; use tracing::instrument; -use tracing::{debug, debug_span, warn}; +use tracing::{debug, warn}; use anyhow::Result; use linux_embedded_hal::gpio_cdev::{Chip, LineRequestFlags}; diff --git a/src/main.rs b/src/main.rs index 2cfde58..5ecc1b1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,11 +3,11 @@ pub mod display; pub mod errors; pub mod imageproc; -use crate::display::{EInkPanel, FakeEInk, Wrapper}; +use crate::display::{EInkPanel, Wrapper}; use crate::imageproc::{DiffusionMatrix, Ditherer, EInkImage, ErrorDiffusionDither}; -use tracing::info; use clap::{Parser, Subcommand}; use image::RgbImage; +use tracing::info; /// Display images over #[derive(Debug, Parser)]