mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
remove unnecessary conversions to make clippy happy
This commit is contained in:
parent
2665159790
commit
670d9e8736
@ -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(
|
||||||
|
@ -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,8 +460,7 @@ 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(),
|
||||||
|
Loading…
Reference in New Issue
Block a user