From de691b9a02dba95c3ebb4d262480309f83c3b553 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 25 Oct 2023 11:28:09 -0500 Subject: [PATCH] refactor(shell): Remove unused write_stdout --- src/cargo/core/shell.rs | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/cargo/core/shell.rs b/src/cargo/core/shell.rs index d4df8a661d7..768c86f7a91 100644 --- a/src/cargo/core/shell.rs +++ b/src/cargo/core/shell.rs @@ -340,13 +340,6 @@ impl Shell { } } - /// Write a styled fragment - /// - /// Caller is responsible for deciding whether [`Shell::verbosity`] is affects output. - pub fn write_stdout(&mut self, fragment: impl fmt::Display, color: &Style) -> CargoResult<()> { - self.output.write_stdout(fragment, color) - } - /// Prints a message to stderr and translates ANSI escape code into console colors. pub fn print_ansi_stderr(&mut self, message: &[u8]) -> CargoResult<()> { if self.needs_clear { @@ -409,17 +402,6 @@ impl ShellOut { Ok(()) } - /// Write a styled fragment - fn write_stdout(&mut self, fragment: impl fmt::Display, style: &Style) -> CargoResult<()> { - let style = style.render(); - let reset = anstyle::Reset.render(); - - let mut buffer = Vec::new(); - write!(buffer, "{style}{}{reset}", fragment)?; - self.stdout().write_all(&buffer)?; - Ok(()) - } - /// Gets stdout as a `io::Write`. fn stdout(&mut self) -> &mut dyn Write { match *self {