summaryrefslogtreecommitdiff
path: root/src/ansi.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ansi.rs')
-rw-r--r--src/ansi.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/ansi.rs b/src/ansi.rs
index f9cd39ac4..95b5e0694 100644
--- a/src/ansi.rs
+++ b/src/ansi.rs
@@ -3,7 +3,6 @@ use ansi_term::Color::Fixed;
use ansi_term::Color::Red;
use ansi_term::Style;
use regex::Regex;
-use std::borrow::Cow;
use std::env;
use std::fmt;
@@ -19,8 +18,8 @@ lazy_static! {
}
/// Helper function to strip ansi codes.
-#[allow(dead_code)]
-pub fn strip_ansi_codes(s: &str) -> Cow<str> {
+#[cfg(test)]
+pub fn strip_ansi_codes(s: &str) -> std::borrow::Cow<str> {
STRIP_ANSI_RE.replace_all(s, "")
}