fix warnings in image converter

This commit is contained in:
Corwin 2023-01-06 18:26:03 +00:00
parent 4e6b4107cb
commit c78b4e62f2
2 changed files with 3 additions and 5 deletions

View file

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

View file

@ -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([