summaryrefslogtreecommitdiffstats
path: root/examples/tictactoe.rs
diff options
context:
space:
mode:
authorPierre-Henri Symoneaux <pierre.henri.symoneaux@gmail.com>2019-08-25 15:12:45 +0200
committerPierre-Henri Symoneaux <pierre.henri.symoneaux@gmail.com>2019-08-25 15:12:45 +0200
commitcb6a033d7a212674c356c1a8365511abe2b4fca9 (patch)
tree414e5927c2bc90245b7005a818f14399f6b05b82 /examples/tictactoe.rs
parent1e06ea72ccf03cd2129d104360e1e07679190a07 (diff)
As suggested in #103, `printstd` should avoid panicking.
Thus, as an improvement, `printstd` now ignores errors, but don't return the printed size anymore. `print_tty` now returns a `Result` and can be used for better control.
Diffstat (limited to 'examples/tictactoe.rs')
-rw-r--r--examples/tictactoe.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/tictactoe.rs b/examples/tictactoe.rs
index 0ff7207..0c299f9 100644
--- a/examples/tictactoe.rs
+++ b/examples/tictactoe.rs
@@ -14,7 +14,7 @@ fn main() {
[EMPTY, EMPTY, EMPTY],
[EMPTY, EMPTY, EMPTY]
];
- let mut height = table.printstd();
+ let mut height = table.print_tty(false).unwrap();
let stdin = io::stdin();
let mut stdout = io::stdout();
let mut current = CROSS;
@@ -53,7 +53,7 @@ fn main() {
terminal.cursor_up().unwrap();
terminal.delete_line().unwrap();
}
- height = table.printstd();
+ height = table.print_tty(false).unwrap();
if check(&table) {
return;
}