diff options
author | tom barrett <spalf0@gmail.com> | 2018-06-05 02:16:56 -0500 |
---|---|---|
committer | tom barrett <spalf0@gmail.com> | 2018-06-05 02:16:56 -0500 |
commit | d2b75c42c1c494c2796188a5d600dddb913f5a5d (patch) | |
tree | 3725afee2759faa15a33956cf50231f5868d689c /src | |
parent | 46f9c0f0c5bfc113bea04c295d9d01114d920cd2 (diff) |
-more clear writing
Diffstat (limited to 'src')
-rw-r--r-- | src/client/mining.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/client/mining.rs b/src/client/mining.rs index 17a7819..f0fcbd0 100644 --- a/src/client/mining.rs +++ b/src/client/mining.rs @@ -21,15 +21,17 @@ pub fn client_mining(mut stream : TcpStream, mut buff_r : BufReader<TcpStream>) write!(stdout, "{}", termion::clear::All).unwrap(); + let clear = termion::cursor::Goto(1,1); + match data.has_astroid_target { true => match data.is_within_range { true => match data.status { - true => write!(stdout, "{}Press F to stop mining.", termion::cursor::Goto(1,1)).unwrap(), - false => write!(stdout, "{}Press F to begin mining.", termion::cursor::Goto(1,1)).unwrap(), + true => write!(stdout, "{}Press F to stop mining.", clear).unwrap(), + false => write!(stdout, "{}Press F to begin mining.", clear).unwrap(), } - false => write!(stdout, "{}Astroid must be within range of {}.", termion::cursor::Goto(1,1), data.range).unwrap(), + false => write!(stdout, "{}Astroid must be within range of {}.", clear, data.range).unwrap(), }, - false => write!(stdout, "{}Ship has no astroid targeted.", termion::cursor::Goto(1,1)).unwrap(), + false => write!(stdout, "{}Ship has no astroid targeted.", clear).unwrap(), } match stdin.next() { |