diff options
author | nc <[email protected]> | 2020-08-08 17:47:08 +0100 |
---|---|---|
committer | nc <[email protected]> | 2020-08-08 17:47:08 +0100 |
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() { | |||
62 | s.set_theme(theme::theme_gen()); | 62 | s.set_theme(theme::theme_gen()); |
63 | s.run(); | 63 | s.run(); |
64 | 64 | ||
65 | let app = std::rc::Rc::try_unwrap(s.find_name::<NamedView<App>>("Main").unwrap() | 65 | s.call_on_name("Main", |app: &mut App| app.save_state()); |
66 | .get_mut() | ||
67 | .into_owner() | ||
68 | .into_owner()).ok().unwrap().into_inner(); | ||
69 | app.save_state(); | ||
70 | |||
71 | } | 66 | } |
72 | } | 67 | } |