diff options
author | nc <charles.saternos@gmail.com> | 2020-08-08 12:47:08 -0400 |
---|---|---|
committer | nc <charles.saternos@gmail.com> | 2020-08-08 12:47:08 -0400 |
commit | 62158c5f142a1838b030c0583c9467a3cb46358b (patch) | |
tree | b5688546d04b9aa7de3ec014ec4333b167c179aa | |
parent | 92b4ecd7006f68f87dff3130b85c00dddacead85 (diff) |
use call_on_name which works and is simpler
-rw-r--r-- | src/main.rs | 7 |
1 files changed, 1 insertions, 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::<NamedView<App>>("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()); } } |