From 1ee65a66cf5439e887639f354fcd7722d21d2fff Mon Sep 17 00:00:00 2001 From: Songtronix <505534-Songtronix@users.noreply.gitlab.com> Date: Mon, 1 Jul 2019 16:38:19 +0000 Subject: [PATCH] Clean server and server-cli --- server/src/cmd.rs | 6 +++--- server/src/lib.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/src/cmd.rs b/server/src/cmd.rs index 543f07f4bd..cb18373aaf 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -149,7 +149,7 @@ fn handle_jump(server: &mut Server, entity: EcsEntity, args: String, action: &Ch fn handle_goto(server: &mut Server, entity: EcsEntity, args: String, action: &ChatCommand) { let (opt_x, opt_y, opt_z) = scan_fmt!(&args, action.arg_fmt, f32, f32, f32); match server.state.read_component_cloned::(entity) { - Some(mut pos) => match (opt_x, opt_y, opt_z) { + Some(_pos) => match (opt_x, opt_y, opt_z) { (Some(x), Some(y), Some(z)) => { server .state @@ -232,7 +232,7 @@ fn handle_tp(server: &mut Server, entity: EcsEntity, args: String, action: &Chat .find(|(_, player)| player.alias == alias) .map(|(entity, _)| entity); match server.state.read_component_cloned::(entity) { - Some(mut pos) => match opt_player { + Some(_pos) => match opt_player { Some(player) => match server.state.read_component_cloned::(player) { Some(pos) => { server.state.write_component(entity, pos); @@ -308,7 +308,7 @@ fn handle_players(server: &mut Server, entity: EcsEntity, _args: String, _action let ecs = server.state.ecs(); let players = ecs.read_storage::(); let count = players.join().count(); - let mut header_message: String = format!("{} online players: \n", count); + let header_message: String = format!("{} online players: \n", count); if count > 0 { let mut player_iter = players.join(); let first = player_iter.next().unwrap().alias.to_owned(); diff --git a/server/src/lib.rs b/server/src/lib.rs index 5159e27806..c9c6702900 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -20,7 +20,7 @@ use common::{ terrain::{TerrainChunk, TerrainChunkSize, TerrainMap}, vol::VolSize, }; -use log::{debug, warn}; +use log::debug; use specs::{join::Join, world::EntityBuilder as EcsEntityBuilder, Builder, Entity as EcsEntity}; use std::{ collections::HashSet, @@ -177,7 +177,7 @@ impl Server { /// Execute a single server tick, handle input and update the game state by the given duration. #[allow(dead_code)] - pub fn tick(&mut self, input: Input, dt: Duration) -> Result, Error> { + pub fn tick(&mut self, _input: Input, dt: Duration) -> Result, Error> { // This tick function is the centre of the Veloren universe. Most server-side things are // managed from here, and as such it's important that it stays organised. Please consult // the core developers before making significant changes to this code. Here is the @@ -442,7 +442,7 @@ impl Server { } } // Invalid player - ClientMsg::Register { player } => { + ClientMsg::Register { .. } => { client.error_state(RequestStateError::Impossible) } ClientMsg::SetViewDistance(view_distance) => match client.client_state {