mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
Make eframe::App::as_any_mut optional to implement (#2061)
This commit is contained in:
@@ -16,11 +16,6 @@ impl eframe::App for EasyMarkApp {
|
||||
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
|
||||
self.editor.panels(ctx);
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
fn as_any_mut(&mut self) -> &mut dyn Any {
|
||||
&mut *self
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -35,11 +30,6 @@ impl eframe::App for DemoApp {
|
||||
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
|
||||
self.demo_windows.ui(ctx);
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
fn as_any_mut(&mut self) -> &mut dyn Any {
|
||||
&mut *self
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -59,11 +49,6 @@ impl eframe::App for FractalClockApp {
|
||||
.ui(ui, Some(crate::seconds_since_midnight()));
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
fn as_any_mut(&mut self) -> &mut dyn Any {
|
||||
&mut *self
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -88,11 +73,6 @@ impl eframe::App for ColorTestApp {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
fn as_any_mut(&mut self) -> &mut dyn Any {
|
||||
&mut *self
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -250,8 +230,8 @@ impl eframe::App for WrapApp {
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
fn as_any_mut(&mut self) -> &mut dyn Any {
|
||||
&mut *self
|
||||
fn as_any_mut(&mut self) -> Option<&mut dyn Any> {
|
||||
Some(&mut *self)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user