Skip to content

Commit de691b9

Browse files
committed
refactor(shell): Remove unused write_stdout
1 parent 6a390da commit de691b9

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

src/cargo/core/shell.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,6 @@ impl Shell {
340340
}
341341
}
342342

343-
/// Write a styled fragment
344-
///
345-
/// Caller is responsible for deciding whether [`Shell::verbosity`] is affects output.
346-
pub fn write_stdout(&mut self, fragment: impl fmt::Display, color: &Style) -> CargoResult<()> {
347-
self.output.write_stdout(fragment, color)
348-
}
349-
350343
/// Prints a message to stderr and translates ANSI escape code into console colors.
351344
pub fn print_ansi_stderr(&mut self, message: &[u8]) -> CargoResult<()> {
352345
if self.needs_clear {
@@ -409,17 +402,6 @@ impl ShellOut {
409402
Ok(())
410403
}
411404

412-
/// Write a styled fragment
413-
fn write_stdout(&mut self, fragment: impl fmt::Display, style: &Style) -> CargoResult<()> {
414-
let style = style.render();
415-
let reset = anstyle::Reset.render();
416-
417-
let mut buffer = Vec::new();
418-
write!(buffer, "{style}{}{reset}", fragment)?;
419-
self.stdout().write_all(&buffer)?;
420-
Ok(())
421-
}
422-
423405
/// Gets stdout as a `io::Write`.
424406
fn stdout(&mut self) -> &mut dyn Write {
425407
match *self {

0 commit comments

Comments
 (0)