Skip to content

Commit e23f5c8

Browse files
committed
Really fix #17982 this time.
1 parent fd53657 commit e23f5c8

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/libterm/win.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ fn color_to_bits(color: color::Color) -> u16 {
7171
}
7272

7373
fn bits_to_color(bits: u16) -> color::Color {
74-
let bits = bits & 0x7;
75-
let color = match bits {
74+
let color = match bits & 0x7 {
7675
0 => color::BLACK,
7776
0x1 => color::BLUE,
7877
0x2 => color::GREEN,
@@ -84,11 +83,7 @@ fn bits_to_color(bits: u16) -> color::Color {
8483
_ => unreachable!()
8584
};
8685

87-
if bits >= 8 {
88-
color | 0x8
89-
} else {
90-
color
91-
}
86+
color | (bits & 0x8) // copy the hi-intensity bit
9287
}
9388

9489
impl<T: Writer+Send> WinConsole<T> {

0 commit comments

Comments
 (0)