Skip to content

Commit

Permalink
update strip-ansi-escapes to their latest api
Browse files Browse the repository at this point in the history
  • Loading branch information
fdncred committed Aug 8, 2023
1 parent ed5e48e commit 5691ba9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
15 changes: 4 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ nu-ansi-term = "0.49.0"
rusqlite = { version = "0.29.0", optional = true }
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0.79", optional = true }
strip-ansi-escapes = "0.1.1"
strip-ansi-escapes = "0.1.2"
strum = "0.25"
strum_macros = "0.25"
thiserror = "1.0.31"
Expand Down
3 changes: 1 addition & 2 deletions src/painting/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ pub(crate) fn coerce_crlf(input: &str) -> Cow<str> {
///
/// If parsing fails silently returns the input string
pub(crate) fn strip_ansi(string: &str) -> String {
strip_ansi_escapes::strip(string)
String::from_utf8(strip_ansi_escapes::strip(string))
.map_err(|_| ())
.and_then(|x| String::from_utf8(x).map_err(|_| ()))
.unwrap_or_else(|_| string.to_owned())
}

Expand Down

0 comments on commit 5691ba9

Please sign in to comment.