From 62158c5f142a1838b030c0583c9467a3cb46358b Mon Sep 17 00:00:00 2001 From: nc Date: Sat, 8 Aug 2020 12:47:08 -0400 Subject: use call_on_name which works and is simpler --- src/main.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1d9efb4..14ddf03 100644 --- a/src/main.rs +++ b/src/main.rs @@ -62,11 +62,6 @@ fn main() { s.set_theme(theme::theme_gen()); s.run(); - let app = std::rc::Rc::try_unwrap(s.find_name::>("Main").unwrap() - .get_mut() - .into_owner() - .into_owner()).ok().unwrap().into_inner(); - app.save_state(); - + s.call_on_name("Main", |app: &mut App| app.save_state()); } } -- cgit v1.2.3