From 0777566bd417c1bbc43a3e8d563db6a5983571a1 Mon Sep 17 00:00:00 2001 From: Louis Capitanchik <contact@louiscap.co> Date: Wed, 22 Feb 2023 15:26:09 +0000 Subject: [PATCH] Fix clippy warnings --- src/commands/reduce.rs | 12 ++++++------ src/commands/split.rs | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/commands/reduce.rs b/src/commands/reduce.rs index 44f739d..490ca5c 100644 --- a/src/commands/reduce.rs +++ b/src/commands/reduce.rs @@ -1,11 +1,11 @@ -use crate::commands::palette::ColourMapping; -use crate::commands::Palette; -use crate::utils::{RgbaOutputFormat, TypedOutputFormat}; + + +use crate::utils::{RgbaOutputFormat}; use anyhow::Error; use clap::Parser; -use image::{GenericImage, ImageBuffer, Rgba, RgbaImage}; +use image::{GenericImage}; use serde::{Deserialize, Serialize}; -use std::collections::HashMap; + /// Limit the number of colours by quantity or threshold #[derive(Debug, Clone, Parser, Serialize, Deserialize)] @@ -27,7 +27,7 @@ pub struct Reduce { } impl Reduce { - pub fn run<T: GenericImage>(&self, mut image: &T) -> anyhow::Result<RgbaOutputFormat> { + pub fn run<T: GenericImage>(&self, _image: &T) -> anyhow::Result<RgbaOutputFormat> { Err(Error::msg("Reduce is not implemented")) // TODO: Reduce impl diff --git a/src/commands/split.rs b/src/commands/split.rs index 9d5c533..06d783d 100644 --- a/src/commands/split.rs +++ b/src/commands/split.rs @@ -1,16 +1,16 @@ -use crate::utils::{RgbaOutputFormat, SpriteData}; -use anyhow::Error; + + use clap::Parser; -use image::imageops::tile; + use image::{ - save_buffer, save_buffer_with_format, GenericImage, GenericImageView, ImageBuffer, ImageFormat, - Pixel, Rgba, RgbaImage, + GenericImageView, ImageFormat, + Pixel, RgbaImage, }; -use num_traits::cast::ToPrimitive; + use num_traits::AsPrimitive; -use rayon::prelude::{IntoParallelIterator, IntoParallelRefIterator}; + use serde::{Deserialize, Serialize}; -use std::io::Read; + use std::path::PathBuf; #[inline(always)] -- GitLab