Skip to content

Commit

Permalink
refactor(report): Don't bother stripping ANSI escape codes
Browse files Browse the repository at this point in the history
`cargo report` calls `Shell::print_ansi_stdout`.  Previously, it didn't
always strip the colors when needed (e.g. `Write` is used).  Now it
does, so don't need to special case this when generating the report.
  • Loading branch information
epage committed Sep 29, 2023
1 parent 94b8364 commit 7332ab0
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/cargo/core/compiler/future_incompat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ impl OnDiskReports {
self.reports.last().map(|r| r.id).unwrap()
}

/// Returns an ANSI-styled report
pub fn get_report(
&self,
id: u32,
Expand Down Expand Up @@ -269,11 +270,6 @@ impl OnDiskReports {

let shell = config.shell();

let to_display = if shell.err_supports_color() && shell.out_supports_color() {
to_display
} else {
anstream::adapter::strip_str(&to_display).to_string()
};
Ok(to_display)
}
}
Expand Down

0 comments on commit 7332ab0

Please sign in to comment.