From c78b4e62f24d1722be7187aa09e7c538a556247c Mon Sep 17 00:00:00 2001 From: Corwin Date: Fri, 6 Jan 2023 18:26:03 +0000 Subject: [PATCH] fix warnings in image converter --- agb-image-converter/src/lib.rs | 5 ++--- agb-image-converter/src/rust_generator.rs | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/agb-image-converter/src/lib.rs b/agb-image-converter/src/lib.rs index a70b801c..656a9bcb 100644 --- a/agb-image-converter/src/lib.rs +++ b/agb-image-converter/src/lib.rs @@ -79,7 +79,7 @@ pub fn include_gfx(input: TokenStream) -> TokenStream { let mut palette256 = Palette256::new(); for (name, settings) in images.iter() { - let image_filename = &parent.join(&settings.filename()); + let image_filename = &parent.join(settings.filename()); let image = Image::load_from_file(image_filename); match settings.colours() { @@ -282,7 +282,7 @@ fn convert_image( optimisation_results: &Palette16OptimisationResults, assignment_offset: Option, ) -> proc_macro2::TokenStream { - let image_filename = &parent.join(&settings.filename()); + let image_filename = &parent.join(settings.filename()); let image = Image::load_from_file(image_filename); rust_generator::generate_code( @@ -339,7 +339,6 @@ fn palette_tile_data( .map(|colour| colour.to_rgb15()) .chain(iter::repeat(0)) .take(16) - .map(|colour| colour as u16) .collect() }) .collect(); diff --git a/agb-image-converter/src/rust_generator.rs b/agb-image-converter/src/rust_generator.rs index 374e6832..84b5632d 100644 --- a/agb-image-converter/src/rust_generator.rs +++ b/agb-image-converter/src/rust_generator.rs @@ -19,8 +19,7 @@ pub(crate) fn generate_palette_code( .into_iter() .map(|colour| colour.to_rgb15()) .chain(iter::repeat(0)) - .take(16) - .map(|colour| colour as u16); + .take(16); quote! { #crate_prefix::display::palette16::Palette16::new([