Switch from ansi_term to yansi (#288)

ansi_term is not actively maintained anymore (see
https://rustsec.org/advisories/RUSTSEC-2021-0139). Replace it with a
suitable alternative.

I looked at termcolor, owo-colors and yansi and picked yansi:

- It is very simple
- It does not do terminal color support checking (we already do that in
  tealdeer)
- Its color enum type is almost identical to the one from ansi_term, so
  migrating is easy

The only change from a config API point of view is that "purple" is now
renamed to "magenta", but "purple" still works.
This commit is contained in:
Danilo Bargen 2022-09-27 23:55:50 +02:00 committed by GitHub
commit 026ae72742
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 22 deletions

View file

@ -20,7 +20,6 @@ name = "tldr"
path = "src/main.rs"
[dependencies]
ansi_term = "0.12.0"
anyhow = "1"
app_dirs = { version = "2", package = "app_dirs2" }
atty = "0.2"
@ -32,6 +31,7 @@ serde = "1.0.21"
serde_derive = "1.0.21"
toml = "0.5.1"
walkdir = "2.0.1"
yansi = "0.5"
zip = { version = "0.6", default-features = false, features = ["deflate"] }
[target.'cfg(not(windows))'.dependencies]