summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authortom barrett <spalf0@gmail.com>2018-04-13 03:39:24 -0500
committertom barrett <spalf0@gmail.com>2018-04-13 03:39:24 -0500
commit4d7a7e368a3f0a6b1261e1b9180a2647eb158047 (patch)
tree50ead62fdc5e22e839920dae44a02dc25b247678 /src/bin
parent74c7e70096ebcb0cab10f24ce1d348198d583161 (diff)
moved over to mass struct with enum for types
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/client.rs2
-rw-r--r--src/bin/server.rs7
2 files changed, 4 insertions, 5 deletions
diff --git a/src/bin/client.rs b/src/bin/client.rs
index 5460652..b690094 100644
--- a/src/bin/client.rs
+++ b/src/bin/client.rs
@@ -46,9 +46,9 @@ fn main() {
stream.write(send.as_bytes()).unwrap();
match module {
+ ModuleType::Mining => client_mining(stream, buff_r),
ModuleType::Dashboard => client_dashboard(buff_r),
ModuleType::Engines => client_engines(stream, buff_r),
ModuleType::Navigation => client_navigation(name, stream, buff_r),
- ModuleType::Mining => client_mining(stream, buff_r),
}
}
diff --git a/src/bin/server.rs b/src/bin/server.rs
index c5954b0..68e091e 100644
--- a/src/bin/server.rs
+++ b/src/bin/server.rs
@@ -7,14 +7,13 @@ use std::collections::HashMap;
use space::mass::Mass;
use space::math::rand_name;
-use space::astroid::Astroid;
use space::connection::Connection;
-fn populate() -> HashMap<String, Box<Mass>> {
- let mut masses : HashMap<String, Box<Mass>> = HashMap::new();
+fn populate() -> HashMap<String, Mass> {
+ let mut masses : HashMap<String, Mass> = HashMap::new();
for _ in 0..10 {
- masses.insert(rand_name(), Box::new(Astroid::new()));
+ masses.insert(rand_name(), Mass::new_astroid());
}
masses