diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs index 28eb8dc..dd068fe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,8 +8,6 @@ use std::error::Error; use std::time::Duration; use std::sync::Arc; -use tokio::sync::Mutex; - use client::*; use commands::Command; @@ -34,14 +32,12 @@ async fn main() -> Result<(), Box<dyn Error>> { client1.stop().await; }); let lst = tokio::spawn(async move { - while client2.is_running().await { - client2.listen().await; - } + client2.listen().await; println!("stop"); }); - lst.await; - cmd.await; + lst.await?; + cmd.await?; Ok(()) } |