File tree 2 files changed +4
-5
lines changed
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>> {
39
39
pub ( crate ) fn stdout ( ) -> Option < Box < StdoutTerminal > > {
40
40
TerminfoTerminal :: new ( io:: stdout ( ) )
41
41
. 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 > ) )
43
43
}
44
44
45
45
/// Terminal color definitions
Original file line number Diff line number Diff line change @@ -113,8 +113,7 @@ impl<T: Write + Send + 'static> WinConsole<T> {
113
113
}
114
114
}
115
115
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 > {
118
117
use std:: mem:: MaybeUninit ;
119
118
120
119
let fg;
@@ -132,13 +131,13 @@ impl<T: Write + Send + 'static> WinConsole<T> {
132
131
bg = color:: BLACK ;
133
132
}
134
133
}
135
- Ok ( WinConsole {
134
+ WinConsole {
136
135
buf : out,
137
136
def_foreground : fg,
138
137
def_background : bg,
139
138
foreground : fg,
140
139
background : bg,
141
- } )
140
+ }
142
141
}
143
142
}
144
143
You can’t perform that action at this time.
0 commit comments