summaryrefslogtreecommitdiffstats
path: root/src/cell.rs
diff options
context:
space:
mode:
authorPierre-Henri Symoneaux <pierre-henri.symoneaux@nokia.com>2016-10-01 21:12:04 +0200
committerPierre-Henri Symoneaux <pierre-henri.symoneaux@nokia.com>2016-10-01 21:13:08 +0200
commitb1535a3c2df755222e583bb3233d347dcf7f77ce (patch)
tree7637e163573cfc3a32a4ef07d312a520dd6187bf /src/cell.rs
parent7461ed06bf117cba39f44297735f24fce89ff941 (diff)
Ignore term NotSupported error on reset when printing cells
Fixes #40
Diffstat (limited to 'src/cell.rs')
-rw-r--r--src/cell.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/cell.rs b/src/cell.rs
index beb6a4a..18185ab 100644
--- a/src/cell.rs
+++ b/src/cell.rs
@@ -183,14 +183,15 @@ impl Cell {
pub fn print_term<T: Terminal+?Sized>(&self, out: &mut T, idx: usize, col_width: usize, skip_right_fill: bool) -> Result<(), Error> {
for a in &self.style {
match out.attr(a.clone()) {
- Ok(ok) => ok,
- Err(::term::Error::NotSupported) => (), // Ignore unsupported atrributes
+ Ok(..) | Err(::term::Error::NotSupported) => (), // Ignore unsupported atrributes
Err(e) => return Err(term_error_to_io_error(e))
};
}
try!(self.print(out, idx, col_width, skip_right_fill));
- try!(out.reset().map_err(term_error_to_io_error));
- Ok(())
+ match out.reset() {
+ Ok(..) | Err(::term::Error::NotSupported) => Ok(()),
+ Err(e) => Err(term_error_to_io_error(e))
+ }
}
}