1
Fork 0

rollup merge of #18476 : vadimcn/17982

This commit is contained in:
Alex Crichton 2014-11-02 18:44:30 -08:00
commit 68e7dd0ffe

View file

@ -71,8 +71,7 @@ fn color_to_bits(color: color::Color) -> u16 {
} }
fn bits_to_color(bits: u16) -> color::Color { fn bits_to_color(bits: u16) -> color::Color {
let bits = bits & 0x7; let color = match bits & 0x7 {
let color = match bits {
0 => color::BLACK, 0 => color::BLACK,
0x1 => color::BLUE, 0x1 => color::BLUE,
0x2 => color::GREEN, 0x2 => color::GREEN,
@ -84,11 +83,7 @@ fn bits_to_color(bits: u16) -> color::Color {
_ => unreachable!() _ => unreachable!()
}; };
if bits >= 8 { color | (bits & 0x8) // copy the hi-intensity bit
color | 0x8
} else {
color
}
} }
impl<T: Writer+Send> WinConsole<T> { impl<T: Writer+Send> WinConsole<T> {