diff options
| -rw-r--r-- | library/test/src/term.rs | 2 | ||||
| -rw-r--r-- | library/test/src/term/win.rs | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/library/test/src/term.rs b/library/test/src/term.rs index b256ab7b8f8..a14b0d4f5a9 100644 --- a/library/test/src/term.rs +++ b/library/test/src/term.rs @@ -39,7 +39,7 @@ pub(crate) fn stdout() -> Option<Box<StdoutTerminal>> { pub(crate) fn stdout() -> Option<Box<StdoutTerminal>> { TerminfoTerminal::new(io::stdout()) .map(|t| Box::new(t) as Box<StdoutTerminal>) - .or_else(|| WinConsole::new(io::stdout()).ok().map(|t| Box::new(t) as Box<StdoutTerminal>)) + .or_else(|| Some(Box::new(WinConsole::new(io::stdout())) as Box<StdoutTerminal>)) } /// Terminal color definitions diff --git a/library/test/src/term/win.rs b/library/test/src/term/win.rs index 4bdbd6ee75f..55020141a82 100644 --- a/library/test/src/term/win.rs +++ b/library/test/src/term/win.rs @@ -113,8 +113,7 @@ impl<T: Write + Send + 'static> WinConsole<T> { } } - /// Returns `None` whenever the terminal cannot be created for some reason. - pub(crate) fn new(out: T) -> io::Result<WinConsole<T>> { + pub(crate) fn new(out: T) -> WinConsole<T> { use std::mem::MaybeUninit; let fg; @@ -132,13 +131,13 @@ impl<T: Write + Send + 'static> WinConsole<T> { bg = color::BLACK; } } - Ok(WinConsole { + WinConsole { buf: out, def_foreground: fg, def_background: bg, foreground: fg, background: bg, - }) + } } } |
