aboutsummaryrefslogtreecommitdiffstats
path: root/mumd/src
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2021-03-30 10:16:15 +0200
committerGustav Sörnäs <gustav@sornas.net>2021-03-30 10:16:15 +0200
commitf81e8a403d6317803a23ba0d43c862e0cfea52ef (patch)
tree6d82abf1c44be6ac16b150b027e492e1189ac6da /mumd/src
parent7fa6078759b095a0ffb5ede05a933249833c9e6f (diff)
downloadmum-f81e8a403d6317803a23ba0d43c862e0cfea52ef.tar.gz
mumlib: re-export error
Diffstat (limited to 'mumd/src')
-rw-r--r--mumd/src/main.rs2
-rw-r--r--mumd/src/network/tcp.rs5
-rw-r--r--mumd/src/state.rs5
3 files changed, 6 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| {