Skip to content

Commit

Permalink
refactor(shell): Remove unused write_stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Oct 25, 2023
1 parent 27b5ac7 commit 1b9aefb
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/cargo/core/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,13 +347,6 @@ impl Shell {
self.output.write_stdout(fragment, color)
}

/// Write a styled fragment
///
/// Caller is responsible for deciding whether [`Shell::verbosity`] is affects output.
pub fn write_stderr(&mut self, fragment: impl fmt::Display, color: &Style) -> CargoResult<()> {
self.output.write_stderr(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 {
Expand Down Expand Up @@ -427,17 +420,6 @@ impl ShellOut {
Ok(())
}

/// Write a styled fragment
fn write_stderr(&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.stderr().write_all(&buffer)?;
Ok(())
}

/// Gets stdout as a `io::Write`.
fn stdout(&mut self) -> &mut dyn Write {
match *self {
Expand Down

0 comments on commit 1b9aefb

Please sign in to comment.