summaryrefslogtreecommitdiffstats
path: root/src/cell.rs
diff options
context:
space:
mode:
authorpierresy <pierre-henri.symoneaux@alcatel-lucent.com>2016-01-11 22:24:17 +0100
committerpierresy <pierre-henri.symoneaux@alcatel-lucent.com>2016-01-11 22:24:17 +0100
commit315f982c8ecc75cb0811a3b7ebde32852a7f6764 (patch)
tree3d3ee3663679eaa9cb5425c15619772d2135353d /src/cell.rs
parent2360c7b4cd53c7bdfd8cdd630db7c4393d828399 (diff)
Ooops, restored those lines I deleted #16
Diffstat (limited to 'src/cell.rs')
-rw-r--r--src/cell.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/cell.rs b/src/cell.rs
index 32aeeeb..40bddd5 100644
--- a/src/cell.rs
+++ b/src/cell.rs
@@ -190,8 +190,7 @@ impl Cell {
match out.attr(a.clone()) {
Ok(ok) => ok,
Err(::term::Error::NotSupported) => (), // Ignore unsupported atrributes
- Err(::term::Error::Io(why)) => return Err(why),
- Err(e) => return Err(Error::new(::std::io::ErrorKind::Other, e))
+ Err(e) => return Err(term_error_to_io_error(e))
};
}
try!(self.print(out, idx, col_width));
@@ -200,6 +199,13 @@ impl Cell {
}
}
+fn term_error_to_io_error(te: ::term::Error) -> Error {
+ match te {
+ ::term::Error::Io(why) => why,
+ _ => Error::new(::std::io::ErrorKind::Other, te),
+ }
+}
+
impl <'a, T: ToString> From<&'a T> for Cell {
fn from(f: &T) -> Cell {
return Cell::new(&f.to_string());