summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorpierresy <pierre-henri.symoneaux@alcatel-lucent.com>2016-01-11 22:19:22 +0100
committerpierresy <pierre-henri.symoneaux@alcatel-lucent.com>2016-01-11 22:20:06 +0100
commit2360c7b4cd53c7bdfd8cdd630db7c4393d828399 (patch)
treedcdeaf8dabccf2f85fa536f5e43a1aa0916db136 /src/lib.rs
parent74f15acde6f32f85a06aeddd4e49dbaf5bb20af3 (diff)
Fixed windows issue for pull request #16
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 4ebb382..20b2389 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -142,10 +142,13 @@ impl <'a> TableSlice<'a> {
/// # Panic
/// Panic if writing to standard output fails
pub fn printstd(&self) {
- match stdout() {
+ let r = match stdout() {
Some(mut o) => self.print_term(&mut *o),
None => self.print(&mut io::stdout()),
- }.ok().expect("Cannot print table to standard output");
+ };
+ if let Err(e) = r {
+ panic!("Cannot print table to standard output : {}", e);
+ }
}
}