Skip to content

Commit

Permalink
chore: remove stale vt100/ctor dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
tommilligan committed Jul 6, 2023
1 parent 26bd02f commit 3f07591
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
5 changes: 0 additions & 5 deletions pretty_assertions/Cargo.toml
Expand Up @@ -32,8 +32,3 @@ unstable = []
[dependencies]
yansi = "0.5"
diff = "0.1.12"

[target.'cfg(windows)'.dependencies]
output_vt100 = "0.1.2"
ctor = "0.1.9"

8 changes: 0 additions & 8 deletions pretty_assertions/src/lib.rs
Expand Up @@ -84,14 +84,6 @@ use core::fmt::{self, Debug, Display};

mod printer;

#[cfg(windows)]
use ctor::*;
#[cfg(windows)]
#[ctor]
fn init() {
output_vt100::try_init().ok(); // Do not panic on fail
}

/// A comparison of two values.
///
/// Where both values implement `Debug`, the comparison can be displayed as a pretty diff.
Expand Down

3 comments on commit 3f07591

@JohnScience
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really a stale dependency? As far as I understand, it enables ANSI escaped characters on Windows so that Command Line or Power Shell can use colors and formatting (e.g. bold font).

@tommilligan
Copy link
Collaborator Author

@tommilligan tommilligan commented on 3f07591 Jul 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JohnScience there was some discussion around this, and we could not reproduce a failure so elected to remove the dependencies. If users report a failing environment, we can then decide whether to support it or not.

Having said all that, I do see that popular tools like ripgrep do still have some windows specific logic (i.e. use termcolor library, which handles this for you internally). I'd be up for migrating our printing internals from yansi to termcolor if that would give wider compatibility

https://github.com/BurntSushi/ripgrep/blob/efb2e8ce1e1277fbfa37329b6663c8cf86d6951a/crates/printer/src/color.rs#L5

@tommilligan
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tracked in #120

Please sign in to comment.