summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authortom barrett <spalf0@gmail.com>2018-02-27 03:36:04 -0600
committertom barrett <spalf0@gmail.com>2018-02-27 03:36:04 -0600
commit87346ea9b91d441e92c476785c2cb979f9a23bf5 (patch)
tree6cf1b044e8f7d895d61a768d9294158d6aab36d0 /src/bin
parentc14dcf1998f5ba1ffea813da4f793fc3bde8c2b7 (diff)
-set up display for navigation system
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/client.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/bin/client.rs b/src/bin/client.rs
index 2e8dd45..d327481 100644
--- a/src/bin/client.rs
+++ b/src/bin/client.rs
@@ -9,21 +9,17 @@ use space::engines::Engines;
use space::navigation::Navigation;
use space::module::{Module, from_primitive};
-
-fn get_info() -> String {
+fn main() {
let mut name = String::new();
println!("Ship Name:");
io::stdin().read_line(&mut name).expect("Failed");
+ name = name.replace("\n", "");
let mut password = String::new();
println!("Password:");
io::stdin().read_line(&mut password).expect("Failed");
- name.replace("\n", "") + ":" + &password
-}
-
-fn main() {
- let send = get_info();
+ let send = name.clone() + ":" + &password;
let mut stream = TcpStream::connect("localhost:6000").unwrap();
let mut buff_r = BufReader::new(stream.try_clone().unwrap());
@@ -47,6 +43,6 @@ fn main() {
match module {
Module::Dashboard => Dashboard(buff_r),
Module::Engines => Engines(stream),
- Module::Navigation => Navigation(stream, buff_r),
+ Module::Navigation => Navigation(name, stream, buff_r),
}
}