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
|
||||
pub fn remove_ansi<'a>(input: &str) -> Vec<Spans<'a>> {
|
||||
let mut output = String::new();
|
||||
for i in categorise_text(input) {
|
||||
output.push_str(i.text);
|
||||
}
|
||||
raw(&output)
|
||||
raw(&categorise_text(input).into_iter().map(|i|i.text).collect::<String>())
|
||||
}
|
||||
|
||||
/// create tui-rs spans that exactly match the given strings
|
||||
|
||||
Reference in New Issue
Block a user