diff --git a/src/utils/iced.rs b/src/utils/iced.rs index 65f2909b..53ceb470 100644 --- a/src/utils/iced.rs +++ b/src/utils/iced.rs @@ -1,5 +1,5 @@ use std::{ - collections::HashMap, + collections::{HashMap, HashSet}, fmt, hash::{Hash, Hasher}, sync::{mpsc::Receiver, Arc, Mutex}, @@ -124,7 +124,7 @@ impl IcedProgram for ProgramWrapper

{ struct IcedElementInternal { // draw buffer - outputs: Vec, + outputs: HashSet, buffers: HashMap, (MemoryRenderBuffer, Option<(Vec, Color)>)>, // state @@ -238,7 +238,7 @@ impl IcedElement

{ .ok(); let mut internal = IcedElementInternal { - outputs: Vec::new(), + outputs: HashSet::new(), buffers: HashMap::new(), size, cursor_pos: None, @@ -569,11 +569,11 @@ impl SpaceElement for IcedElement

{ ), ); } - internal.outputs.push(output.clone()); + internal.outputs.insert(output.clone()); } fn output_leave(&self, output: &Output) { - self.0.lock().unwrap().outputs.retain(|o| o != output); + self.0.lock().unwrap().outputs.remove(output); self.refresh(); }