mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 21:00:03 -04:00
Make eframe::App::as_any_mut optional to implement (#2061)
This commit is contained in:
@@ -266,8 +266,14 @@ impl AppRunner {
|
||||
}
|
||||
|
||||
/// Get mutable access to the concrete [`App`] we enclose.
|
||||
///
|
||||
/// This will panic if your app does not implement [`App::as_any_mut`].
|
||||
pub fn app_mut<ConreteApp: 'static + crate::App>(&mut self) -> &mut ConreteApp {
|
||||
self.app.as_any_mut().downcast_mut::<ConreteApp>().unwrap()
|
||||
self.app
|
||||
.as_any_mut()
|
||||
.expect("Your app must implement `as_any_mut`, but it doesn't")
|
||||
.downcast_mut::<ConreteApp>()
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
pub fn auto_save(&mut self) {
|
||||
|
||||
Reference in New Issue
Block a user