remove clippy warnings no longer needed

This commit is contained in:
Marcel Märtens 2020-10-19 00:57:43 +02:00
parent e9be36c993
commit 2290efd219
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
pub struct Sys;
impl<'a> System<'a> for Sys {
#[allow(clippy::type_complexity)] // TODO: Pending review in #587
#[allow(clippy::type_complexity)]
type SystemData = (
Entities<'a>,
Read<'a, EventBus<ServerEvent>>,
@ -144,9 +144,6 @@ impl<'a> System<'a> for Sys {
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(
&mut self,
(
@ -196,19 +193,16 @@ impl<'a> System<'a> for Sys {
)
});
match res {
Ok(1_u64..=u64::MAX) => {
// Update client ping.
client.last_ping = time.0
},
_ => (/*handled by ping*/),
if let Ok(1_u64..=u64::MAX) = res {
// Update client ping.
client.last_ping = time.0
}
}
// Handle new chat messages.
for (entity, msg) in new_chat_msgs {
// Handle chat commands.
if msg.message.starts_with("/") {
if msg.message.starts_with('/') {
if let (Some(entity), true) = (entity, msg.message.len() > 1) {
let argv = String::from(&msg.message[1..]);
server_emitter.emit(ServerEvent::ChatCmd(entity, argv));

View File

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

View File

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

View File

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

View File

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