From 315f982c8ecc75cb0811a3b7ebde32852a7f6764 Mon Sep 17 00:00:00 2001 From: pierresy Date: Mon, 11 Jan 2016 22:24:17 +0100 Subject: Ooops, restored those lines I deleted #16 --- src/cell.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/cell.rs') 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()); -- cgit v1.2.3