diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-11-17 21:51:47 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-11-17 21:51:47 -0500 |
commit | 96f335c58f9b9b9035a43f106f2dfddbe62777e7 (patch) | |
tree | 72aeab9e256f165b49fbf1e1c7983e94a5ff3539 /src/main.rs | |
parent | 26bb4e54e9669b487817d09ebfa36836293d741d (diff) | |
download | nbsh-96f335c58f9b9b9035a43f106f2dfddbe62777e7.tar.gz nbsh-96f335c58f9b9b9035a43f106f2dfddbe62777e7.zip |
pull output out of the state struct
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index 05b889c..ba8fa8a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,8 +25,8 @@ async fn async_main() -> anyhow::Result<()> { let (action_w, action_r) = async_std::channel::unbounded(); - let mut state = state::State::new(action_w, output); - state.render(true).await.unwrap(); + let mut state = state::State::new(action_w); + state.render(&mut output, true).await.unwrap(); let state = util::mutex(state); @@ -55,7 +55,11 @@ async fn async_main() -> anyhow::Result<()> { let debouncer = crate::action::debounce(action_r); while let Some(action) = debouncer.recv().await { - state.lock_arc().await.handle_action(action).await; + state + .lock_arc() + .await + .handle_action(action, &mut output) + .await; } Ok(()) |