Skip to content

Commit

Permalink
rollup merge of rust-lang#18476 : vadimcn/17982
Browse files Browse the repository at this point in the history
alexcrichton committed Nov 3, 2014

Verified

This commit was signed with the committer’s verified signature.
sagikazarmark Márk Sági-Kazár
2 parents 6478fcf + e23f5c8 commit 68e7dd0
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/libterm/win.rs
Original file line number Diff line number Diff line change
@@ -71,8 +71,7 @@ fn color_to_bits(color: color::Color) -> u16 {
}

fn bits_to_color(bits: u16) -> color::Color {
let bits = bits & 0x7;
let color = match bits {
let color = match bits & 0x7 {
0 => color::BLACK,
0x1 => color::BLUE,
0x2 => color::GREEN,
@@ -84,11 +83,7 @@ fn bits_to_color(bits: u16) -> color::Color {
_ => unreachable!()
};

if bits >= 8 {
color | 0x8
} else {
color
}
color | (bits & 0x8) // copy the hi-intensity bit
}

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

0 comments on commit 68e7dd0

Please sign in to comment.