kill more color allocations, missed a few usages

pull/14/head
chris west 4 years ago
parent 71a2394d73
commit 52f1e88ec2

@ -214,19 +214,20 @@ impl Menu {
} else { } else {
if line.link == self.link && self.show_cursor() { if line.link == self.link && self.show_cursor() {
out.push_str(color!(Bold)); out.push_str(color!(Bold));
out.push_str("*"); out.push('*');
out.push_str(color!(Reset)); out.push_str(color!(Reset));
} else { } else {
out.push(' '); out.push(' ');
} }
out.push(' '); out.push(' ');
out.push_str("\x1b[95m"); out.push_str(color!(Magenta));
if line.link < 9 { if line.link < 9 {
out.push(' '); out.push(' ');
} }
let num = (line.link + 1).to_string(); let num = (line.link + 1).to_string();
out.push_str(&num); out.push_str(&num);
out.push_str(".\x1b[0m "); out.push_str(". ");
out.push_str(color!(Reset));
} }
// truncate long lines, instead of wrapping // truncate long lines, instead of wrapping
@ -238,9 +239,11 @@ impl Menu {
// color the line // color the line
if line.typ.is_download() { if line.typ.is_download() {
out.push_str(&color_string!(text, Underline, White)); out.push_str(color!(Underline));
out.push_str(color!(White));
} else if !line.typ.is_supported() { } else if !line.typ.is_supported() {
out.push_str(&color_string!(text, Red, WhiteBG)); out.push_str(color!(WhiteBG));
out.push_str(color!(Red));
} else { } else {
out.push_str(&match line.typ { out.push_str(&match line.typ {
Type::Text => color!(Cyan), Type::Text => color!(Cyan),
@ -249,6 +252,7 @@ impl Menu {
Type::HTML => color!(Green), Type::HTML => color!(Green),
Type::Error => color!(Red), Type::Error => color!(Red),
Type::Telnet => color!(Grey), Type::Telnet => color!(Grey),
Type::Search => color!(White),
_ => color!(Red), _ => color!(Red),
}); });
} }

Loading…
Cancel
Save