From bd90426dc6430df92c3e697d9e6226d9d5f57e8d Mon Sep 17 00:00:00 2001 From: Melik Houij Date: Fri, 24 Mar 2023 08:47:49 +0100 Subject: [PATCH] fixed --- src/debug.rs | 21 +++++++++++---------- src/main.rs | 2 -- 2 files changed, 11 insertions(+), 12 deletions(-) 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;