Use anstream to avoid writing colorized output (#415)
A more robust solution to avoiding colorized output by ensuring we write to `stdout` and `stderr` via the [`anstream`](https://docs.rs/anstream/latest/anstream/) crate. Closes https://github.com/astral-sh/puffin/issues/393.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use anstream::eprint;
|
||||
use indicatif::ProgressDrawTarget;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
@@ -26,7 +27,7 @@ impl std::fmt::Write for Printer {
|
||||
fn write_str(&mut self, s: &str) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::Default | Self::Verbose => {
|
||||
#[allow(clippy::print_stderr)]
|
||||
#[allow(clippy::print_stderr, clippy::ignored_unit_patterns)]
|
||||
{
|
||||
eprint!("{s}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user