forked from lavina/lavina
fix some warnings
This commit is contained in:
parent
71d7323534
commit
bba1ea107d
|
@ -112,9 +112,8 @@ impl PlayerHandle {
|
|||
pub async fn subscribe(&self) -> PlayerConnection {
|
||||
let (sender, receiver) = channel(32);
|
||||
let (promise, deferred) = oneshot();
|
||||
self.tx
|
||||
.send(PlayerCommand::AddConnection { sender, promise })
|
||||
.await;
|
||||
let cmd = PlayerCommand::AddConnection { sender, promise };
|
||||
let _ = self.tx.send(cmd).await;
|
||||
let connection_id = deferred.await.unwrap();
|
||||
PlayerConnection {
|
||||
connection_id,
|
||||
|
@ -135,7 +134,7 @@ impl PlayerHandle {
|
|||
body,
|
||||
promise,
|
||||
};
|
||||
self.tx.send(PlayerCommand::Cmd(cmd, connection_id)).await;
|
||||
let _ = self.tx.send(PlayerCommand::Cmd(cmd, connection_id)).await;
|
||||
Ok(deferred.await?)
|
||||
}
|
||||
|
||||
|
@ -145,16 +144,13 @@ impl PlayerHandle {
|
|||
connection_id: ConnectionId,
|
||||
) -> Result<JoinResult> {
|
||||
let (promise, deferred) = oneshot();
|
||||
let cmd = Cmd::JoinRoom {
|
||||
room_id,
|
||||
promise: promise,
|
||||
};
|
||||
self.tx.send(PlayerCommand::Cmd(cmd, connection_id)).await;
|
||||
let cmd = Cmd::JoinRoom { room_id, promise };
|
||||
let _ = self.tx.send(PlayerCommand::Cmd(cmd, connection_id)).await;
|
||||
Ok(deferred.await?)
|
||||
}
|
||||
|
||||
async fn send(&self, command: PlayerCommand) {
|
||||
self.tx.send(command).await;
|
||||
let _ = self.tx.send(command).await;
|
||||
}
|
||||
|
||||
pub async fn update(&self, update: Updates) {
|
||||
|
@ -316,7 +312,7 @@ impl Player {
|
|||
for (_, handle) in &self.my_rooms {
|
||||
response.push(handle.get_room_info().await);
|
||||
}
|
||||
promise.send(response);
|
||||
let _ = promise.send(response);
|
||||
}
|
||||
PlayerCommand::Update(update) => {
|
||||
log::info!(
|
||||
|
@ -331,7 +327,7 @@ impl Player {
|
|||
_ => {}
|
||||
}
|
||||
for (_, connection) in &self.connections {
|
||||
connection.send(update.clone()).await;
|
||||
let _ = connection.send(update.clone()).await;
|
||||
}
|
||||
}
|
||||
PlayerCommand::Cmd(cmd, connection_id) => self.handle_cmd(cmd, connection_id).await,
|
||||
|
@ -350,7 +346,7 @@ impl Player {
|
|||
match cmd {
|
||||
Cmd::JoinRoom { room_id, promise } => {
|
||||
if self.banned_from.contains(&room_id) {
|
||||
promise.send(JoinResult::Banned);
|
||||
let _ = promise.send(JoinResult::Banned);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -359,7 +355,7 @@ impl Player {
|
|||
.await;
|
||||
self.my_rooms.insert(room_id.clone(), room.clone());
|
||||
let room_info = room.get_room_info().await;
|
||||
promise.send(JoinResult::Success(room_info));
|
||||
let _ = promise.send(JoinResult::Success(room_info));
|
||||
let update = Updates::RoomJoined {
|
||||
room_id,
|
||||
new_member_id: self.player_id.clone(),
|
||||
|
@ -372,7 +368,7 @@ impl Player {
|
|||
room.unsubscribe(&self.player_id).await;
|
||||
let room_info = room.get_room_info().await;
|
||||
}
|
||||
promise.send(());
|
||||
let _ = promise.send(());
|
||||
let update = Updates::RoomLeft {
|
||||
room_id,
|
||||
former_member_id: self.player_id.clone(),
|
||||
|
@ -391,7 +387,7 @@ impl Player {
|
|||
} else {
|
||||
tracing::info!("no room found");
|
||||
}
|
||||
promise.send(());
|
||||
let _ = promise.send(());
|
||||
let update = Updates::NewMessage {
|
||||
room_id,
|
||||
author_id: self.player_id.clone(),
|
||||
|
@ -411,7 +407,7 @@ impl Player {
|
|||
} else {
|
||||
tracing::info!("no room found");
|
||||
}
|
||||
promise.send(());
|
||||
let _ = promise.send(());
|
||||
let update = Updates::RoomTopicChanged { room_id, new_topic };
|
||||
self.broadcast_update(update, connection_id).await;
|
||||
}
|
||||
|
@ -423,7 +419,7 @@ impl Player {
|
|||
if ConnectionId(a) == except {
|
||||
continue;
|
||||
}
|
||||
b.send(update.clone()).await;
|
||||
let _ = b.send(update.clone()).await;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,10 +4,8 @@ use quick_xml::name::{Namespace, QName, ResolveResult};
|
|||
use quick_xml::{NsReader, Writer};
|
||||
use tokio::io::{AsyncBufRead, AsyncWrite};
|
||||
|
||||
use super::client::Message;
|
||||
use super::skip_text;
|
||||
use crate::prelude::*;
|
||||
use crate::util::xml::{Continuation, FromXml, Parser};
|
||||
|
||||
pub static XMLNS: &'static str = "http://etherx.jabber.org/streams";
|
||||
pub static PREFIX: &'static str = "stream";
|
||||
|
|
Loading…
Reference in New Issue