@@ -201,7 +201,7 @@ where
201201 for (x, y, cell) in content {
202202 // Move the cursor if the previous location was not (x - 1, y)
203203 if !matches!(last_pos, Some(p) if x == p.0 + 1 && y == p.1) {
204− map_error(queue!(self.buffer, MoveTo(x, y)))?;
204+ queue!(self.buffer, MoveTo(x, y))?;
205205 }
206206 last_pos = Some((x, y));
207207 if cell.modifier != modifier {
@@ -214,12 +214,12 @@ where
214214 }
215215 if cell.fg != fg {
216216 let color = CColor::from(cell.fg);
217− map_error(queue!(self.buffer, SetForegroundColor(color)))?;
217+ queue!(self.buffer, SetForegroundColor(color))?;
218218 fg = cell.fg;
219219 }
220220 if cell.bg != bg {
221221 let color = CColor::from(cell.bg);
222− map_error(queue!(self.buffer, SetBackgroundColor(color)))?;
222+ queue!(self.buffer, SetBackgroundColor(color))?;
223223 bg = cell.bg;
224224 }
225225
@@ -227,7 +227,7 @@ where
227227 if self.capabilities.has_extended_underlines {
228228 if cell.underline_color != underline_color {
229229 let color = CColor::from(cell.underline_color);
230− map_error(queue!(self.buffer, SetUnderlineColor(color)))?;
230+ queue!(self.buffer, SetUnderlineColor(color))?;
231231 underline_color = cell.underline_color;
232232 }
233233 } else {
@@ -239,24 +239,24 @@ where
239239
240240 if new_underline_style != underline_style {
241241 let attr = CAttribute::from(new_underline_style);
242− map_error(queue!(self.buffer, SetAttribute(attr)))?;
242+ queue!(self.buffer, SetAttribute(attr))?;
243243 underline_style = new_underline_style;
244244 }
245245
246− map_error(queue!(self.buffer, Print(&cell.symbol)))?;
246+ queue!(self.buffer, Print(&cell.symbol))?;
247247 }
248248
249− map_error(queue!(
249+ queue!(
250250 self.buffer,
251251 SetUnderlineColor(CColor::Reset),
252252 SetForegroundColor(CColor::Reset),
253253 SetBackgroundColor(CColor::Reset),
254254 SetAttribute(CAttribute::Reset)
255− ))
255+ )
256256 }
257257
258258 fn hide_cursor(&mut self) -> io::Result<()> {
259− map_error(execute!(self.buffer, Hide))
259+ execute!(self.buffer, Hide)
260260 }
261261
262262 fn show_cursor(&mut self, kind: CursorKind) -> io::Result<()> {
@@ -266,7 +266,7 @@ where
266266 CursorKind::Underline => SetCursorStyle::SteadyUnderScore,
267267 CursorKind::Hidden => unreachable!(),
268268 };
269− map_error(execute!(self.buffer, Show, shape))
269+ execute!(self.buffer, Show, shape)
270270 }
271271
272272 fn get_cursor(&mut self) -> io::Result<(u16, u16)> {
@@ -275,11 +275,11 @@ where
275275 }
276276
277277 fn set_cursor(&mut self, x: u16, y: u16) -> io::Result<()> {
278− map_error(execute!(self.buffer, MoveTo(x, y)))
278+ execute!(self.buffer, MoveTo(x, y))
279279 }
280280
281281 fn clear(&mut self) -> io::Result<()> {
282− map_error(execute!(self.buffer, Clear(ClearType::All)))
282+ execute!(self.buffer, Clear(ClearType::All))
283283 }
284284
285285 fn size(&self) -> io::Result<Rect> {
@@ -294,10 +294,6 @@ where
294294 }
295295}
296296
297−fn map_error(error: crossterm::Result<()>) -> io::Result<()> {
298− error.map_err(|e| io::Error::new(io::ErrorKind::Other, e.to_string()))
299−}
300−
301297#[derive(Debug)]
302298struct ModifierDiff {
303299 pub from: Modifier,
@@ -312,48 +308,48 @@ impl ModifierDiff {
312308 //use crossterm::Attribute;
313309 let removed = self.from - self.to;
314310 if removed.contains(Modifier::REVERSED) {
315− map_error(queue!(w, SetAttribute(CAttribute::NoReverse)))?;
311+ queue!(w, SetAttribute(CAttribute::NoReverse))?;
316312 }
317313 if removed.contains(Modifier::BOLD) {
318− map_error(queue!(w, SetAttribute(CAttribute::NormalIntensity)))?;
314+ queue!(w, SetAttribute(CAttribute::NormalIntensity))?;
319315 if self.to.contains(Modifier::DIM) {
320− map_error(queue!(w, SetAttribute(CAttribute::Dim)))?;
316+ queue!(w, SetAttribute(CAttribute::Dim))?;
321317 }
322318 }
323319 if removed.contains(Modifier::ITALIC) {
324− map_error(queue!(w, SetAttribute(CAttribute::NoItalic)))?;
320+ queue!(w, SetAttribute(CAttribute::NoItalic))?;
325321 }
326322 if removed.contains(Modifier::DIM) {
327− map_error(queue!(w, SetAttribute(CAttribute::NormalIntensity)))?;
323+ queue!(w, SetAttribute(CAttribute::NormalIntensity))?;
328324 }
329325 if removed.contains(Modifier::CROSSED_OUT) {
330− map_error(queue!(w, SetAttribute(CAttribute::NotCrossedOut)))?;
326+ queue!(w, SetAttribute(CAttribute::NotCrossedOut))?;
331327 }
332328 if removed.contains(Modifier::SLOW_BLINK) || removed.contains(Modifier::RAPID_BLINK) {
333− map_error(queue!(w, SetAttribute(CAttribute::NoBlink)))?;
329+ queue!(w, SetAttribute(CAttribute::NoBlink))?;
334330 }
335331
336332 let added = self.to - self.from;
337333 if added.contains(Modifier::REVERSED) {
338− map_error(queue!(w, SetAttribute(CAttribute::Reverse)))?;
334+ queue!(w, SetAttribute(CAttribute::Reverse))?;
339335 }
340336 if added.contains(Modifier::BOLD) {
341− map_error(queue!(w, SetAttribute(CAttribute::Bold)))?;
337+ queue!(w, SetAttribute(CAttribute::Bold))?;
342338 }
343339 if added.contains(Modifier::ITALIC) {
344− map_error(queue!(w, SetAttribute(CAttribute::Italic)))?;
340+ queue!(w, SetAttribute(CAttribute::Italic))?;
345341 }
346342 if added.contains(Modifier::DIM) {
347− map_error(queue!(w, SetAttribute(CAttribute::Dim)))?;
343+ queue!(w, SetAttribute(CAttribute::Dim))?;
348344 }
349345 if added.contains(Modifier::CROSSED_OUT) {
350− map_error(queue!(w, SetAttribute(CAttribute::CrossedOut)))?;
346+ queue!(w, SetAttribute(CAttribute::CrossedOut))?;
351347 }
352348 if added.contains(Modifier::SLOW_BLINK) {
353− map_error(queue!(w, SetAttribute(CAttribute::SlowBlink)))?;
349+ queue!(w, SetAttribute(CAttribute::SlowBlink))?;
354350 }
355351 if added.contains(Modifier::RAPID_BLINK) {
356− map_error(queue!(w, SetAttribute(CAttribute::RapidBlink)))?;
352+ queue!(w, SetAttribute(CAttribute::RapidBlink))?;
357353 }
358354
359355 Ok(())
@@ -407,7 +403,7 @@ impl Command for SetUnderlineColor {
407403 }
408404
409405 #[cfg(windows)]
410− fn execute_winapi(&self) -> crossterm::Result<()> {
406+ fn execute_winapi(&self) -> io::Result<()> {
411407 Err(std::io::Error::new(
412408 std::io::ErrorKind::Other,
413409 "SetUnderlineColor not supported by winapi.",