macro goodness
This commit is contained in:
1 parent
0b8a93c5ce
commit
8d1a810483
9 files changed
+131
-61
No files matched your search
+4
-1
@@ -52,7 +52,10 @@ pub trait HasUiState: Sized + 'static + HasUi {
|
||||
fn ui_state(&mut self) -> &mut UiState<Self>;
|
||||
fn ui_with_ui_state(&mut self) -> (&mut Ui<Self>, &mut UiState<Self>) {
|
||||
// as long as you're not doing anything actually unhinged this should always work safely
|
||||
(unsafe { std::mem::transmute(self.ui()) }, self.ui_state())
|
||||
(
|
||||
unsafe { std::mem::transmute::<&mut Ui<Self>, &mut Ui<Self>>(self.ui()) },
|
||||
self.ui_state(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user