diff options
| author | Eskil Queseth <eskilq@kth.se> | 2020-10-31 02:37:24 +0100 |
|---|---|---|
| committer | Eskil Queseth <eskilq@kth.se> | 2020-10-31 02:37:24 +0100 |
| commit | d72b0fe5862a99d9ce1a0ef37938f4517de36ed7 (patch) | |
| tree | 00bae1b69ee302bb52bfb24d3fb22a34bccb3792 /mumd/src/command.rs | |
| parent | 11c823701b12f10933b40044a12cc4048ccf8bd2 (diff) | |
| download | mum-d72b0fe5862a99d9ce1a0ef37938f4517de36ed7.tar.gz | |
cargo fmt
Diffstat (limited to 'mumd/src/command.rs')
| -rw-r--r-- | mumd/src/command.rs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/mumd/src/command.rs b/mumd/src/command.rs index ff53dc7..330e3fc 100644 --- a/mumd/src/command.rs +++ b/mumd/src/command.rs @@ -1,13 +1,13 @@ -use crate::state::{State, ExecutionContext}; +use crate::state::{ExecutionContext, State}; use crate::network::tcp::{TcpEvent, TcpEventCallback}; use ipc_channel::ipc::IpcSender; use log::*; +use mumble_protocol::ping::PongPacket; use mumlib::command::{Command, CommandResponse}; +use std::net::SocketAddr; use std::sync::{Arc, Mutex}; use tokio::sync::{mpsc, oneshot}; -use mumble_protocol::ping::PongPacket; -use std::net::SocketAddr; pub async fn handle( state: Arc<Mutex<State>>, @@ -45,13 +45,17 @@ pub async fn handle( ExecutionContext::Ping(generator, converter) => { match generator() { Ok(addr) => { - let res = ping_request_sender.send((0, addr, Box::new(move |packet| { - response_sender.send(converter(packet)).unwrap(); - }))); + let res = ping_request_sender.send(( + 0, + addr, + Box::new(move |packet| { + response_sender.send(converter(packet)).unwrap(); + }), + )); if res.is_err() { panic!(); } - }, + } Err(e) => { response_sender.send(Err(e)).unwrap(); } |
