1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-10-03 18:42:28 +01:00

PR #102 Followed @BrainMaestro's suggestions

Also ran cargo fmt.
This commit is contained in:
eth-p
2018-05-13 03:26:23 -07:00
parent 9f005d115d
commit 870b3c0daf
4 changed files with 42 additions and 45 deletions

View File

@@ -1,5 +1,3 @@
use std::fmt::Write;
use ansi_term::Colour::{Fixed, RGB};
use ansi_term::Style;
use syntect::highlighting::{self, FontStyle};
@@ -32,7 +30,6 @@ pub fn as_terminal_escaped(
true_color: bool,
colored: bool,
) -> String {
let style = if !colored {
Style::default()
} else {
@@ -54,9 +51,7 @@ pub fn as_terminal_escaped(
}
};
let mut s: String = String::new();
write!(s, "{}", style.paint(text)).unwrap();
return s;
style.paint(text).to_string()
}
#[test]