Skip to content

Commit a1baa69

Browse files
committed
make strip-ansi-escapes an optional dependency
1 parent 1c8b077 commit a1baa69

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,18 @@ edition = "2021"
1212
rust-version = "1.70"
1313

1414
[features]
15-
default = ["timestamps", "uuids"]
15+
default = ["timestamps", "uuids", "strip-ansi"]
1616
timestamps = ["dep:chrono"]
1717
uuids = ["dep:uuid", "dep:newtype-uuid"]
18+
strip-ansi = ["dep:strip-ansi-escapes"]
1819

1920
[dependencies]
2021
chrono = { version = "0.4.41", default-features = false, features = ["std"], optional = true }
2122
indexmap = "2.7.1"
2223
quick-xml = "0.38.1"
2324
newtype-uuid = { version = "1.2.4", optional = true }
2425
thiserror = "2.0.12"
25-
strip-ansi-escapes = "0.2.1"
26+
strip-ansi-escapes = { version = "0.2.1", optional = true }
2627
uuid = { version = "1.17.0", optional = true }
2728

2829
[dev-dependencies]

src/report.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,7 @@ impl XmlString {
740740
/// Creates a new `XmlString`, removing any ANSI escapes and non-printable characters from it.
741741
pub fn new(data: impl AsRef<str>) -> Self {
742742
let data = data.as_ref();
743+
#[cfg(feature = "strip-ansi")]
743744
let data = strip_ansi_escapes::strip_str(data);
744745
let data = data
745746
.replace(

0 commit comments

Comments
 (0)