diff --git a/src/debug.rs b/src/debug.rs index ef1d5db..ac29990 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -26,7 +26,7 @@ pub enum Callback MainMenu, } -#[derive(Clone)] +#[derive(Clone, PartialEq)] pub enum OpenWindows { ModelInfo, TestWind, @@ -121,16 +121,17 @@ impl Debug { let mut id = 0; for (hashId, windowType) in &self.windows { - if let _window = windowType {id = *hashId; println!("found a match!")}; - match windowType - { - window => id = *hashId, - _ => () - } - + if *windowType == window { + id = *hashId; + break; } - self.windows.remove(&id); - self.free_ids.push(id); + + } + if id !=0 + { + self.windows.remove(&id); + self.free_ids.push(id); + } } fn displayTest(ui: &mut imgui::Ui, testI: &mut info::testI) -> Vec diff --git a/src/main.rs b/src/main.rs index 2b51156..85a9ced 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,8 +28,6 @@ use sdl2::pixels::Color; use sdl2::keyboard::Keycode; use sdl2::event::Event; -use std::sync::mpsc::Receiver; -use std::ptr; use std::mem; use std::os::raw::c_void; use std::path::Path;