From 756c42609dfe30200aef5ef1c9f36c47206e6493 Mon Sep 17 00:00:00 2001 From: Aleksander Date: Sat, 14 Feb 2026 16:04:36 +0100 Subject: [PATCH] use SlotMap --- wayvr/src/windowing/manager.rs | 6 +++--- wgui/src/layout.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wayvr/src/windowing/manager.rs b/wayvr/src/windowing/manager.rs index 3bfb613d..c7f01d11 100644 --- a/wayvr/src/windowing/manager.rs +++ b/wayvr/src/windowing/manager.rs @@ -6,7 +6,7 @@ use std::{ use anyhow::Context; use glam::{Affine3A, Vec3, Vec3A}; -use slotmap::{HopSlotMap, Key, SecondaryMap}; +use slotmap::{Key, SecondaryMap, SlotMap}; use wgui::log::LogErr; use wlx_common::{ astr_containers::{AStrMap, AStrMapExt}, @@ -42,7 +42,7 @@ pub const MAX_OVERLAY_SETS: usize = 6; pub struct OverlayWindowManager { wrappers: EditWrapperManager, - overlays: HopSlotMap>, + overlays: SlotMap>, sets: Vec, global_set: OverlayWindowSet, /// The set that is currently visible. @@ -65,7 +65,7 @@ where pub fn new(app: &mut AppState, headless: bool) -> anyhow::Result { let mut me = Self { wrappers: EditWrapperManager::default(), - overlays: HopSlotMap::with_key(), + overlays: SlotMap::>::with_key(), current_set: Some(0), restore_set: 0, sets: vec![OverlayWindowSet::default()], diff --git a/wgui/src/layout.rs b/wgui/src/layout.rs index 18d656d1..5a19cdec 100644 --- a/wgui/src/layout.rs +++ b/wgui/src/layout.rs @@ -18,7 +18,7 @@ use crate::{ use anyhow::Context; use glam::{Vec2, vec2}; -use slotmap::{HopSlotMap, SecondaryMap, new_key_type}; +use slotmap::{SecondaryMap, SlotMap, new_key_type}; use taffy::{NodeId, TaffyTree, TraversePartialTree}; new_key_type! { @@ -57,7 +57,7 @@ impl WeakWidget { } } -pub struct WidgetMap(HopSlotMap); +pub struct WidgetMap(SlotMap); pub type WidgetNodeMap = SecondaryMap; #[derive(Clone)] @@ -68,7 +68,7 @@ pub struct WidgetPair { impl WidgetMap { fn new() -> Self { - Self(HopSlotMap::with_key()) + Self(SlotMap::::with_key()) } pub fn get_as(&self, handle: WidgetID) -> Option> {