From 96f335c58f9b9b9035a43f106f2dfddbe62777e7 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 17 Nov 2021 21:51:47 -0500 Subject: pull output out of the state struct --- src/main.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main.rs') 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(()) -- cgit v1.2.3-54-g00ecf