summaryrefslogtreecommitdiffstats
path: root/src/cell.rs
diff options
context:
space:
mode:
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());