refactor: remove_ansi to single liner
This commit is contained in:
@@ -41,11 +41,7 @@ pub mod log_sanitizer {
|
|||||||
|
|
||||||
/// Remove all ansi formatting from a given string and create tui-rs spans
|
/// Remove all ansi formatting from a given string and create tui-rs spans
|
||||||
pub fn remove_ansi<'a>(input: &str) -> Vec<Spans<'a>> {
|
pub fn remove_ansi<'a>(input: &str) -> Vec<Spans<'a>> {
|
||||||
let mut output = String::new();
|
raw(&categorise_text(input).into_iter().map(|i|i.text).collect::<String>())
|
||||||
for i in categorise_text(input) {
|
|
||||||
output.push_str(i.text);
|
|
||||||
}
|
|
||||||
raw(&output)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// create tui-rs spans that exactly match the given strings
|
/// create tui-rs spans that exactly match the given strings
|
||||||
|
|||||||
Reference in New Issue
Block a user