Fix compilation with persistence feature
This commit is contained in:
parent
42ec177881
commit
9766a9ae08
11
src/app.rs
11
src/app.rs
|
@ -29,8 +29,15 @@ impl epi::App for TemplateApp {
|
|||
|
||||
/// Called by the framework to load old app state (if any).
|
||||
#[cfg(feature = "persistence")]
|
||||
fn load(&mut self, storage: &dyn epi::Storage) {
|
||||
*self = epi::get_value(storage, epi::APP_KEY).unwrap_or_default()
|
||||
fn setup(
|
||||
&mut self,
|
||||
_ctx: &egui::CtxRef,
|
||||
_frame: &mut epi::Frame<'_>,
|
||||
storage: Option<&dyn epi::Storage>,
|
||||
) {
|
||||
if let Some(storage) = storage {
|
||||
*self = epi::get_value(storage, epi::APP_KEY).unwrap_or_default()
|
||||
}
|
||||
}
|
||||
|
||||
/// Called by the frame work to save state before shutdown.
|
||||
|
|
Loading…
Reference in a new issue