cargo fmt; clippy fix

This commit is contained in:
saji 2024-07-27 23:06:23 -05:00
parent fa367e6436
commit 7e5d13849e
3 changed files with 9 additions and 10 deletions

View file

@ -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<EInkImage>,
@ -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(())

View file

@ -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};

View file

@ -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)]