We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd53657 commit e23f5c8Copy full SHA for e23f5c8
src/libterm/win.rs
@@ -71,8 +71,7 @@ fn color_to_bits(color: color::Color) -> u16 {
71
}
72
73
fn bits_to_color(bits: u16) -> color::Color {
74
- let bits = bits & 0x7;
75
- let color = match bits {
+ let color = match bits & 0x7 {
76
0 => color::BLACK,
77
0x1 => color::BLUE,
78
0x2 => color::GREEN,
@@ -84,11 +83,7 @@ fn bits_to_color(bits: u16) -> color::Color {
84
83
_ => unreachable!()
85
};
86
87
- if bits >= 8 {
88
- color | 0x8
89
- } else {
90
- color
91
- }
+ color | (bits & 0x8) // copy the hi-intensity bit
92
93
94
impl<T: Writer+Send> WinConsole<T> {
0 commit comments