cleanup crate imports
authoralfadur
Fri, 14 Sep 2018 23:14:19 +0300
changeset 13810 0463a4221327
parent 13809 201d86010a8b
child 13811 54725a1d1db8
cleanup crate imports
gameServer2/src/main.rs
gameServer2/src/protocol/parser.rs
gameServer2/src/protocol/test.rs
gameServer2/src/server/client.rs
gameServer2/src/server/handlers/inroom.rs
gameServer2/src/server/handlers/lobby.rs
gameServer2/src/server/handlers/loggingin.rs
gameServer2/src/server/handlers/mod.rs
gameServer2/src/server/network.rs
gameServer2/src/server/room.rs
gameServer2/src/server/server.rs
--- a/gameServer2/src/main.rs	Thu Sep 13 20:59:57 2018 +0300
+++ b/gameServer2/src/main.rs	Fri Sep 14 23:14:19 2018 +0300
@@ -1,30 +1,12 @@
 #![allow(unused_imports)]
 #![deny(bare_trait_objects)]
 
-extern crate rand;
-extern crate mio;
-extern crate slab;
-extern crate netbuf;
-extern crate base64;
-#[macro_use]
-extern crate nom;
-#[macro_use]
-extern crate log;
-extern crate env_logger;
-#[cfg(test)]
-#[macro_use] extern crate proptest;
-#[macro_use] extern crate bitflags;
-extern crate serde;
-extern crate serde_yaml;
-#[cfg(feature = "tls-connections")]
-extern crate openssl;
-#[macro_use] extern crate serde_derive;
-
 //use std::io::*;
 //use rand::Rng;
 //use std::cmp::Ordering;
 use mio::net::*;
 use mio::*;
+use log::*;
 
 mod utils;
 mod server;
--- a/gameServer2/src/protocol/parser.rs	Thu Sep 13 20:59:57 2018 +0300
+++ b/gameServer2/src/protocol/parser.rs	Fri Sep 14 23:14:19 2018 +0300
@@ -17,7 +17,10 @@
     messages::{HWProtocolMessage, HWProtocolMessage::*}
 };
 #[cfg(test)]
-use super::test::gen_proto_msg;
+use {
+    super::test::gen_proto_msg,
+    proptest::{proptest, proptest_helper}
+};
 use crate::server::coretypes::{
     HedgehogInfo, TeamInfo, GameCfg, VoteType, MAX_HEDGEHOGS_PER_TEAM
 };
--- a/gameServer2/src/protocol/test.rs	Thu Sep 13 20:59:57 2018 +0300
+++ b/gameServer2/src/protocol/test.rs	Fri Sep 14 23:14:19 2018 +0300
@@ -1,7 +1,7 @@
 use proptest::{
     test_runner::{TestRunner, Reason},
     arbitrary::{any, any_with, Arbitrary, StrategyFor},
-    strategy::{Strategy, BoxedStrategy, Just, Map},
+    strategy::{Strategy, BoxedStrategy, Just, Map}
 };
 
 use crate::server::coretypes::{GameCfg, TeamInfo, HedgehogInfo};
--- a/gameServer2/src/server/client.rs	Thu Sep 13 20:59:57 2018 +0300
+++ b/gameServer2/src/server/client.rs	Fri Sep 14 23:14:19 2018 +0300
@@ -1,4 +1,5 @@
 use super::coretypes::ClientId;
+use bitflags::*;
 
 bitflags!{
     pub struct ClientFlags: u8 {
--- a/gameServer2/src/server/handlers/inroom.rs	Thu Sep 13 20:59:57 2018 +0300
+++ b/gameServer2/src/server/handlers/inroom.rs	Fri Sep 14 23:14:19 2018 +0300
@@ -23,6 +23,7 @@
 };
 use base64::{encode, decode};
 use super::common::rnd_reply;
+use log::*;
 
 #[derive(Clone)]
 struct ByMsg<'a> {
--- a/gameServer2/src/server/handlers/lobby.rs	Thu Sep 13 20:59:57 2018 +0300
+++ b/gameServer2/src/server/handlers/lobby.rs	Fri Sep 14 23:14:19 2018 +0300
@@ -13,6 +13,7 @@
     utils::is_name_illegal
 };
 use super::common::rnd_reply;
+use log::*;
 
 pub fn handle(server: &mut HWServer, client_id: ClientId, message: HWProtocolMessage) {
     use crate::protocol::messages::HWProtocolMessage::*;
--- a/gameServer2/src/server/handlers/loggingin.rs	Thu Sep 13 20:59:57 2018 +0300
+++ b/gameServer2/src/server/handlers/loggingin.rs	Fri Sep 14 23:14:19 2018 +0300
@@ -15,6 +15,7 @@
 #[cfg(feature = "official-server")]
 use openssl::sha::sha1;
 use std::fmt::{Formatter, LowerHex};
+use log::*;
 
 #[derive(PartialEq)]
 struct Sha1Digest([u8; 20]);
--- a/gameServer2/src/server/handlers/mod.rs	Thu Sep 13 20:59:57 2018 +0300
+++ b/gameServer2/src/server/handlers/mod.rs	Fri Sep 14 23:14:19 2018 +0300
@@ -12,6 +12,7 @@
         HWServerMessage::*
     }
 };
+use log::*;
 
 mod loggingin;
 mod lobby;
--- a/gameServer2/src/server/network.rs	Thu Sep 13 20:59:57 2018 +0300
+++ b/gameServer2/src/server/network.rs	Fri Sep 14 23:14:19 2018 +0300
@@ -13,6 +13,7 @@
 };
 use netbuf;
 use slab::Slab;
+use log::*;
 
 use crate::{
     utils,
--- a/gameServer2/src/server/room.rs	Thu Sep 13 20:59:57 2018 +0300
+++ b/gameServer2/src/server/room.rs	Fri Sep 14 23:14:19 2018 +0300
@@ -8,7 +8,9 @@
     },
     client::{HWClient}
 };
+use bitflags::*;
 use serde::{Serialize, Deserialize};
+use serde_derive::{Serialize, Deserialize};
 use serde_yaml;
 
 const MAX_TEAMS_IN_ROOM: u8 = 8;
--- a/gameServer2/src/server/server.rs	Thu Sep 13 20:59:57 2018 +0300
+++ b/gameServer2/src/server/server.rs	Fri Sep 14 23:14:19 2018 +0300
@@ -8,6 +8,7 @@
 use crate::protocol::messages::*;
 use rand::{RngCore, thread_rng};
 use base64::{encode};
+use log::*;
 
 type Slab<T> = slab::Slab<T>;