re-use strip_colors

This commit is contained in:
Anton-4 2024-02-16 16:32:46 +01:00
parent 00d1ac0aef
commit f66711d53e
No known key found for this signature in database
GPG key ID: 0971D718C0A9B937
5 changed files with 23 additions and 27 deletions

View file

@ -98,20 +98,6 @@ pub fn path_to_binary(binary_name: &str) -> PathBuf {
path
}
pub fn strip_colors(str: &str) -> String {
use roc_reporting::report::ANSI_STYLE_CODES;
str.replace(ANSI_STYLE_CODES.red, "")
.replace(ANSI_STYLE_CODES.green, "")
.replace(ANSI_STYLE_CODES.yellow, "")
.replace(ANSI_STYLE_CODES.cyan, "")
.replace(ANSI_STYLE_CODES.white, "")
.replace(ANSI_STYLE_CODES.bold, "")
.replace(ANSI_STYLE_CODES.underline, "")
.replace(ANSI_STYLE_CODES.reset, "")
.replace(ANSI_STYLE_CODES.color_reset, "")
}
pub fn run_roc_with_stdin<I, S>(args: I, stdin_vals: &[&str]) -> Out
where
I: IntoIterator<Item = S>,