diff --git a/src/layout/widgets.rs b/src/layout/widgets.rs index 4fbbb3a..262cd28 100644 --- a/src/layout/widgets.rs +++ b/src/layout/widgets.rs @@ -37,7 +37,10 @@ impl Widgets { pub fn get_dyn_dynamic(&self, id: &Id) -> WidgetWrapper<'_> { // SAFETY: must guarantee no other mutable references to this widget exist // done through the borrow variable - let data: &mut WidgetData = unsafe { std::mem::transmute(self.map.get(id)) }; + #[allow(mutable_transmutes)] + let data = unsafe { + std::mem::transmute::<&WidgetData, &mut WidgetData>(self.map.get(id).unwrap()) + }; if data.borrowed { panic!("tried to mutably borrow the same widget twice"); }