Skip to content

Commit 7332ab0

Browse files
committed
refactor(report): Don't bother stripping ANSI escape codes
`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.
1 parent 94b8364 commit 7332ab0

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/cargo/core/compiler/future_incompat.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ impl OnDiskReports {
224224
self.reports.last().map(|r| r.id).unwrap()
225225
}
226226

227+
/// Returns an ANSI-styled report
227228
pub fn get_report(
228229
&self,
229230
id: u32,
@@ -269,11 +270,6 @@ impl OnDiskReports {
269270

270271
let shell = config.shell();
271272

272-
let to_display = if shell.err_supports_color() && shell.out_supports_color() {
273-
to_display
274-
} else {
275-
anstream::adapter::strip_str(&to_display).to_string()
276-
};
277273
Ok(to_display)
278274
}
279275
}

0 commit comments

Comments
 (0)