File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ pub(crate) fn stdout() -> Option<Box<StdoutTerminal>> {
3939pub ( crate ) fn stdout ( ) -> Option < Box < StdoutTerminal > > {
4040 TerminfoTerminal :: new ( io:: stdout ( ) )
4141 . map ( |t| Box :: new ( t) as Box < StdoutTerminal > )
42- . or_else ( || WinConsole :: new ( io:: stdout ( ) ) . ok ( ) . map ( |t| Box :: new ( t ) as Box < StdoutTerminal > ) )
42+ . or_else ( || Some ( Box :: new ( WinConsole :: new ( io:: stdout ( ) ) ) as Box < StdoutTerminal > ) )
4343}
4444
4545/// Terminal color definitions
Original file line number Diff line number Diff line change @@ -113,8 +113,7 @@ impl<T: Write + Send + 'static> WinConsole<T> {
113113 }
114114 }
115115
116- /// Returns `None` whenever the terminal cannot be created for some reason.
117- pub ( crate ) fn new ( out : T ) -> io:: Result < WinConsole < T > > {
116+ pub ( crate ) fn new ( out : T ) -> WinConsole < T > {
118117 use std:: mem:: MaybeUninit ;
119118
120119 let fg;
@@ -132,13 +131,13 @@ impl<T: Write + Send + 'static> WinConsole<T> {
132131 bg = color:: BLACK ;
133132 }
134133 }
135- Ok ( WinConsole {
134+ WinConsole {
136135 buf : out,
137136 def_foreground : fg,
138137 def_background : bg,
139138 foreground : fg,
140139 background : bg,
141- } )
140+ }
142141 }
143142}
144143
You can’t perform that action at this time.
0 commit comments