remove clippy warnings no longer needed

This commit is contained in:
Marcel Märtens 2020-10-19 00:57:43 +02:00
parent bfe623fe8d
commit cc6f094e8a
5 changed files with 19 additions and 46 deletions

View File

@ -128,7 +128,7 @@ impl Sys {
/// This system will handle new messages from clients /// This system will handle new messages from clients
pub struct Sys; pub struct Sys;
impl<'a> System<'a> for Sys { impl<'a> System<'a> for Sys {
#[allow(clippy::type_complexity)] // TODO: Pending review in #587 #[allow(clippy::type_complexity)]
type SystemData = ( type SystemData = (
Entities<'a>, Entities<'a>,
Read<'a, EventBus<ServerEvent>>, Read<'a, EventBus<ServerEvent>>,
@ -144,9 +144,6 @@ impl<'a> System<'a> for Sys {
ReadExpect<'a, AliasValidator>, ReadExpect<'a, AliasValidator>,
); );
#[allow(clippy::match_ref_pats)] // TODO: Pending review in #587
#[allow(clippy::single_char_pattern)] // TODO: Pending review in #587
#[allow(clippy::single_match)] // TODO: Pending review in #587
fn run( fn run(
&mut self, &mut self,
( (
@ -196,19 +193,16 @@ impl<'a> System<'a> for Sys {
) )
}); });
match res { if let Ok(1_u64..=u64::MAX) = res {
Ok(1_u64..=u64::MAX) => { // Update client ping.
// Update client ping. client.last_ping = time.0
client.last_ping = time.0
},
_ => (/*handled by ping*/),
} }
} }
// Handle new chat messages. // Handle new chat messages.
for (entity, msg) in new_chat_msgs { for (entity, msg) in new_chat_msgs {
// Handle chat commands. // Handle chat commands.
if msg.message.starts_with("/") { if msg.message.starts_with('/') {
if let (Some(entity), true) = (entity, msg.message.len() > 1) { if let (Some(entity), true) = (entity, msg.message.len() > 1) {
let argv = String::from(&msg.message[1..]); let argv = String::from(&msg.message[1..]);
server_emitter.emit(ServerEvent::ChatCmd(entity, argv)); server_emitter.emit(ServerEvent::ChatCmd(entity, argv));

View File

@ -72,7 +72,7 @@ impl Sys {
/// This system will handle new messages from clients /// This system will handle new messages from clients
pub struct Sys; pub struct Sys;
impl<'a> System<'a> for Sys { impl<'a> System<'a> for Sys {
#[allow(clippy::type_complexity)] // TODO: Pending review in #587 #[allow(clippy::type_complexity)]
type SystemData = ( type SystemData = (
Entities<'a>, Entities<'a>,
Read<'a, EventBus<ServerEvent>>, Read<'a, EventBus<ServerEvent>>,
@ -85,9 +85,6 @@ impl<'a> System<'a> for Sys {
WriteStorage<'a, GeneralStream>, WriteStorage<'a, GeneralStream>,
); );
#[allow(clippy::match_ref_pats)] // TODO: Pending review in #587
#[allow(clippy::single_char_pattern)] // TODO: Pending review in #587
#[allow(clippy::single_match)] // TODO: Pending review in #587
fn run( fn run(
&mut self, &mut self,
( (
@ -125,19 +122,16 @@ impl<'a> System<'a> for Sys {
) )
}); });
match res { if let Ok(1_u64..=u64::MAX) = res {
Ok(1_u64..=u64::MAX) => { // Update client ping.
// Update client ping. client.last_ping = time.0
client.last_ping = time.0
},
_ => (/*handled by ping*/),
} }
} }
// Handle new chat messages. // Handle new chat messages.
for (entity, msg) in new_chat_msgs { for (entity, msg) in new_chat_msgs {
// Handle chat commands. // Handle chat commands.
if msg.message.starts_with("/") { if msg.message.starts_with('/') {
if let (Some(entity), true) = (entity, msg.message.len() > 1) { if let (Some(entity), true) = (entity, msg.message.len() > 1) {
let argv = String::from(&msg.message[1..]); let argv = String::from(&msg.message[1..]);
server_emitter.emit(ServerEvent::ChatCmd(entity, argv)); server_emitter.emit(ServerEvent::ChatCmd(entity, argv));

View File

@ -177,7 +177,7 @@ impl Sys {
/// This system will handle new messages from clients /// This system will handle new messages from clients
pub struct Sys; pub struct Sys;
impl<'a> System<'a> for Sys { impl<'a> System<'a> for Sys {
#[allow(clippy::type_complexity)] // TODO: Pending review in #587 #[allow(clippy::type_complexity)]
type SystemData = ( type SystemData = (
Entities<'a>, Entities<'a>,
Read<'a, EventBus<ServerEvent>>, Read<'a, EventBus<ServerEvent>>,
@ -199,9 +199,6 @@ impl<'a> System<'a> for Sys {
Read<'a, Settings>, Read<'a, Settings>,
); );
#[allow(clippy::match_ref_pats)] // TODO: Pending review in #587
#[allow(clippy::single_char_pattern)] // TODO: Pending review in #587
#[allow(clippy::single_match)] // TODO: Pending review in #587
fn run( fn run(
&mut self, &mut self,
( (
@ -255,12 +252,9 @@ impl<'a> System<'a> for Sys {
) )
}); });
match res { if let Ok(1_u64..=u64::MAX) = res {
Ok(1_u64..=u64::MAX) => { // Update client ping.
// Update client ping. client.last_ping = time.0
client.last_ping = time.0
},
_ => (/*handled by ping*/),
} }
} }

View File

@ -30,7 +30,7 @@ impl Sys {
/// This system will handle new messages from clients /// This system will handle new messages from clients
pub struct Sys; pub struct Sys;
impl<'a> System<'a> for Sys { impl<'a> System<'a> for Sys {
#[allow(clippy::type_complexity)] // TODO: Pending review in #587 #[allow(clippy::type_complexity)]
type SystemData = ( type SystemData = (
Entities<'a>, Entities<'a>,
Read<'a, EventBus<ServerEvent>>, Read<'a, EventBus<ServerEvent>>,
@ -42,9 +42,6 @@ impl<'a> System<'a> for Sys {
Read<'a, Settings>, Read<'a, Settings>,
); );
#[allow(clippy::match_ref_pats)] // TODO: Pending review in #587
#[allow(clippy::single_char_pattern)] // TODO: Pending review in #587
#[allow(clippy::single_match)] // TODO: Pending review in #587
fn run( fn run(
&mut self, &mut self,
( (

View File

@ -90,7 +90,7 @@ impl Sys {
/// This system will handle new messages from clients /// This system will handle new messages from clients
pub struct Sys; pub struct Sys;
impl<'a> System<'a> for Sys { impl<'a> System<'a> for Sys {
#[allow(clippy::type_complexity)] // TODO: Pending review in #587 #[allow(clippy::type_complexity)]
type SystemData = ( type SystemData = (
Entities<'a>, Entities<'a>,
Read<'a, Time>, Read<'a, Time>,
@ -107,9 +107,6 @@ impl<'a> System<'a> for Sys {
ReadExpect<'a, EditableSettings>, ReadExpect<'a, EditableSettings>,
); );
#[allow(clippy::match_ref_pats)] // TODO: Pending review in #587
#[allow(clippy::single_char_pattern)] // TODO: Pending review in #587
#[allow(clippy::single_match)] // TODO: Pending review in #587
fn run( fn run(
&mut self, &mut self,
( (
@ -174,12 +171,9 @@ impl<'a> System<'a> for Sys {
) )
}); });
match res { if let Ok(1_u64..=u64::MAX) = res {
Ok(1_u64..=u64::MAX) => { // Update client ping.
// Update client ping. client.last_ping = time.0
client.last_ping = time.0
},
_ => (/*handled by ping*/),
} }
} }