diff options
| -rw-r--r-- | mumd/src/main.rs | 2 | ||||
| -rw-r--r-- | mumd/src/network/tcp.rs | 5 | ||||
| -rw-r--r-- | mumd/src/state.rs | 5 | ||||
| -rw-r--r-- | mumlib/src/lib.rs | 2 |
4 files changed, 8 insertions, 6 deletions
diff --git a/mumd/src/main.rs b/mumd/src/main.rs index 26e8d49..276e2ce 100644 --- a/mumd/src/main.rs +++ b/mumd/src/main.rs @@ -34,7 +34,7 @@ async fn main() { bincode::serialize_into((&mut command).writer(), &Command::Ping).unwrap(); if let Ok(()) = writer.send(command.freeze()).await { if let Some(Ok(buf)) = reader.next().await { - if let Ok(Ok::<Option<CommandResponse>, mumlib::error::Error>(Some(CommandResponse::Pong))) = bincode::deserialize(&buf) { + if let Ok(Ok::<Option<CommandResponse>, mumlib::Error>(Some(CommandResponse::Pong))) = bincode::deserialize(&buf) { error!("Another instance of mumd is already running"); return; } diff --git a/mumd/src/network/tcp.rs b/mumd/src/network/tcp.rs index fb5869d..bf16110 100644 --- a/mumd/src/network/tcp.rs +++ b/mumd/src/network/tcp.rs @@ -8,7 +8,6 @@ use mumble_protocol::control::{msgs, ClientControlCodec, ControlCodec, ControlPa use mumble_protocol::crypt::ClientCryptState; use mumble_protocol::voice::VoicePacket; use mumble_protocol::{Clientbound, Serverbound}; -use mumlib::error::Error; use std::collections::HashMap; use std::convert::{Into, TryInto}; use std::net::SocketAddr; @@ -39,7 +38,7 @@ pub enum TcpEvent { #[derive(Clone)] pub enum TcpEventData<'a> { - Connected(Result<&'a msgs::ServerSync, Error>), + Connected(Result<&'a msgs::ServerSync, mumlib::Error>), _Disconnected, } @@ -317,7 +316,7 @@ async fn listen( debug!("Login rejected: {:?}", msg); match msg.get_field_type() { msgs::Reject_RejectType::WrongServerPW => { - event_queue.send(TcpEventData::Connected(Err(Error::InvalidServerPassword))).await; + event_queue.send(TcpEventData::Connected(Err(mumlib::Error::InvalidServerPassword))).await; } ty => { warn!("Unhandled reject type: {:?}", ty); diff --git a/mumd/src/state.rs b/mumd/src/state.rs index e666bcf..20fe660 100644 --- a/mumd/src/state.rs +++ b/mumd/src/state.rs @@ -15,7 +15,8 @@ use mumble_protocol::ping::PongPacket; use mumble_protocol::voice::Serverbound; use mumlib::command::{Command, CommandResponse}; use mumlib::config::Config; -use mumlib::error::{ChannelIdentifierError, Error}; +use mumlib::error::ChannelIdentifierError; +use mumlib::Error; use crate::state::user::UserDiff; use std::net::{SocketAddr, ToSocketAddrs}; use tokio::sync::{mpsc, watch}; @@ -381,7 +382,7 @@ impl State { .map(|mut e| e.next()) { Ok(Some(v)) => Ok(v), - _ => Err(mumlib::error::Error::InvalidServerAddr(host, port)), + _ => Err(Error::InvalidServerAddr(host, port)), } }), Box::new(move |pong| { diff --git a/mumlib/src/lib.rs b/mumlib/src/lib.rs index bccf073..36edc10 100644 --- a/mumlib/src/lib.rs +++ b/mumlib/src/lib.rs @@ -3,6 +3,8 @@ pub mod config; pub mod error; pub mod state; +pub use error::Error; + use colored::*; use log::*; |
