Added groups + ran rust fmt / clippy.

This commit is contained in:
Paul Makles
2020-04-09 15:41:26 +01:00
parent 82f6e6215f
commit e6ed46af82
11 changed files with 192 additions and 90 deletions

View File

@@ -37,7 +37,7 @@ impl Handler for Server {
if let Value::String(packet_type) = &data["type"] {
match packet_type.as_str() {
"authenticate" => {
if let Some(_) = self.id {
if self.id.is_some() {
self.out.send(
json!({
"type": "authenticate",
@@ -152,7 +152,7 @@ impl Handler for Server {
pub fn launch_server() {
unsafe {
if let Err(_) = CLIENTS.set(RwLock::new(HashMap::new())) {
if CLIENTS.set(RwLock::new(HashMap::new())).is_err() {
panic!("Failed to set CLIENTS map!");
}
}