summaryrefslogtreecommitdiff
path: root/src/client/dashboard.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/dashboard.rs')
-rw-r--r--src/client/dashboard.rs28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/client/dashboard.rs b/src/client/dashboard.rs
index 5815ee2..ec1fd4b 100644
--- a/src/client/dashboard.rs
+++ b/src/client/dashboard.rs
@@ -1,14 +1,14 @@
-extern crate termion;
extern crate serde_json;
+extern crate termion;
-use std::net::TcpStream;
-use std::io::{BufRead, BufReader, stdout, Write, Read};
-use self::termion::raw::IntoRawMode;
use self::termion::async_stdin;
+use self::termion::raw::IntoRawMode;
+use std::io::{stdout, BufRead, BufReader, Read, Write};
+use std::net::TcpStream;
-use mass::Mass;
+use crate::mass::Mass;
-pub fn client_dashboard(mut buff_r : BufReader<TcpStream>) {
+pub fn client_dashboard(mut buff_r: BufReader<TcpStream>) {
let stdout = stdout();
let mut stdout = stdout.lock().into_raw_mode().unwrap();
let mut stdin = async_stdin().bytes();
@@ -16,15 +16,19 @@ pub fn client_dashboard(mut buff_r : BufReader<TcpStream>) {
loop {
let mut recv = String::new();
buff_r.read_line(&mut recv).unwrap();
- let ship : Mass = serde_json::from_str(&recv).unwrap();
+ let ship: Mass = serde_json::from_str(&recv).unwrap();
- write!(stdout, "{}{}{:?}",
- termion::clear::All,
- termion::cursor::Goto(1,1),
- ship).unwrap();
+ write!(
+ stdout,
+ "{}{}{:?}",
+ termion::clear::All,
+ termion::cursor::Goto(1, 1),
+ ship
+ )
+ .unwrap();
if let Some(c) = stdin.next() {
- let c = c.unwrap() as char;
+ let c = c.unwrap() as char;
if c == 'q' {
break;
}