Extract variable for output_variable_name

This commit is contained in:
Gwilym Kuiper 2021-07-21 21:01:24 +01:00
parent 53952d8e34
commit 47c5c0f86e
2 changed files with 3 additions and 1 deletions

View file

@ -57,6 +57,7 @@ pub fn convert_image(settings: ImageConverterConfig) {
rust_generator::generate_code(
&mut writer,
"test",
&optimisation_results,
&image,
settings.tile_size,

View file

@ -7,13 +7,14 @@ use crate::TileSize;
pub(crate) fn generate_code(
output: &mut dyn Write,
output_variable_name: &str,
results: &Palette16OptimisationResults,
image: &Image,
tile_size: TileSize,
crate_prefix: String,
) -> io::Result<()> {
writeln!(output, "#[allow(non_upper_case_globals)]")?;
writeln!(output, "pub const {}: {}::display::tile_data::TileData = {{", "test", crate_prefix)?;
writeln!(output, "pub const {}: {}::display::tile_data::TileData = {{", output_variable_name, crate_prefix)?;
writeln!(
output,