From 8fa56c5b6f7a266407b282b37154c6804644c4e4 Mon Sep 17 00:00:00 2001 From: Mwa Date: Tue, 17 Mar 2026 21:05:51 +0100 Subject: [PATCH] compilation fix --- bitmap_to_asm/src/main.rs | 11 +++++++---- simu/src/main.rs | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/bitmap_to_asm/src/main.rs b/bitmap_to_asm/src/main.rs index 15d65a8..8987673 100644 --- a/bitmap_to_asm/src/main.rs +++ b/bitmap_to_asm/src/main.rs @@ -1,5 +1,5 @@ use regex::Regex; -use std::env::args; +use std::{borrow::Cow, env::args}; fn main() { let path = args().nth(1).expect("usage: 1 image file argument"); @@ -12,9 +12,9 @@ fn main() { println!(" D 0x{d:08x}"); } } -fn remove_non_alphanumeric(input: &str) -> String { +fn remove_non_alphanumeric(input: &str) -> Cow<'_, str> { let re = Regex::new(r"[^a-zA-Z0-9_]+").unwrap(); - re.replace_all(input, "").to_string() + re.replace_all(input, "") } fn path_to_img(path: &str) -> (Vec, String, u32, u32) { @@ -48,6 +48,9 @@ fn path_to_img(path: &str) -> (Vec, String, u32, u32) { } let path = path.split('/').next_back().unwrap(); let split: Vec<_> = path.split('.').collect(); - let name = remove_non_alphanumeric(&split[0..split.len() - 1].join("_")).to_lowercase(); + let name = format!( + "picture_{}", + remove_non_alphanumeric(&split[0..split.len() - 1].join("_")).to_lowercase() + ); (bytes, name, width, height) } diff --git a/simu/src/main.rs b/simu/src/main.rs index 57d4dfc..274932a 100644 --- a/simu/src/main.rs +++ b/simu/src/main.rs @@ -21,9 +21,9 @@ use winit::application::ApplicationHandler; use winit::dpi::LogicalSize; use winit::event::WindowEvent; use winit::event_loop::EventLoop; +use winit::platform::modifier_supplement::KeyEventExtModifierSupplement; use winit::platform::scancode::PhysicalKeyExtScancode; use winit::window::Window; -// use winit_input_helper::WinitInputHelper; use crate::cpu::{Computer, MMIOInterupt}; mod wait;