remove unnecessary conversions to make clippy happy

This commit is contained in:
Monty Marz 2020-06-28 15:15:00 +02:00
parent 2665159790
commit 670d9e8736
2 changed files with 8 additions and 9 deletions

View File

@ -211,7 +211,7 @@ impl StateExt for State {
// Notify clients of a player list update // Notify clients of a player list update
let client_uid = self let client_uid = self
.read_component_cloned::<Uid>(entity) .read_component_cloned::<Uid>(entity)
.map(|u| u.into()) .map(|u| u)
.expect("Client doesn't have a Uid!!!"); .expect("Client doesn't have a Uid!!!");
self.notify_registered_clients(ServerMsg::PlayerListUpdate( self.notify_registered_clients(ServerMsg::PlayerListUpdate(

View File

@ -92,7 +92,7 @@ impl<'a> System<'a> for Sys {
let player_list = (&uids, &players, stats.maybe(), admins.maybe()) let player_list = (&uids, &players, stats.maybe(), admins.maybe())
.join() .join()
.map(|(uid, player, stats, admin)| { .map(|(uid, player, stats, admin)| {
((*uid).into(), PlayerInfo { (*uid, PlayerInfo {
is_online: true, is_online: true,
is_admin: admin.is_some(), is_admin: admin.is_some(),
player_alias: player.alias.clone(), player_alias: player.alias.clone(),
@ -460,13 +460,12 @@ impl<'a> System<'a> for Sys {
// Tell all clients to add them to the player list. // Tell all clients to add them to the player list.
for entity in new_players { for entity in new_players {
if let (Some(uid), Some(player)) = (uids.get(entity), players.get(entity)) { if let (Some(uid), Some(player)) = (uids.get(entity), players.get(entity)) {
let msg = let msg = ServerMsg::PlayerListUpdate(PlayerListUpdate::Add(*uid, PlayerInfo {
ServerMsg::PlayerListUpdate(PlayerListUpdate::Add((*uid).into(), PlayerInfo { player_alias: player.alias.clone(),
player_alias: player.alias.clone(), is_online: true,
is_online: true, is_admin: admins.get(entity).is_some(),
is_admin: admins.get(entity).is_some(), character: None, // new players will be on character select.
character: None, // new players will be on character select. }));
}));
for client in (&mut clients).join().filter(|c| c.is_registered()) { for client in (&mut clients).join().filter(|c| c.is_registered()) {
client.notify(msg.clone()) client.notify(msg.clone())
} }