Skip to content

Commit

Permalink
fix(fmt): Fix passing of WriteStyle when using Target::Pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobo1239 committed Jan 27, 2024
1 parent 8f4361b commit 6f31706
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/fmt/writer/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@ impl BufferWriter {
}
}

pub(in crate::fmt::writer) fn pipe(pipe: Box<Mutex<dyn io::Write + Send + 'static>>) -> Self {
pub(in crate::fmt::writer) fn pipe(
pipe: Box<Mutex<dyn io::Write + Send + 'static>>,
write_style: WriteStyle,
) -> Self {
BufferWriter {
target: WritableTarget::Pipe(pipe),
write_style: WriteStyle::Never,
write_style,
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/fmt/writer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl Builder {
let writer = match mem::take(&mut self.target) {
Target::Stdout => BufferWriter::stdout(self.is_test, color_choice),
Target::Stderr => BufferWriter::stderr(self.is_test, color_choice),
Target::Pipe(pipe) => BufferWriter::pipe(Box::new(Mutex::new(pipe))),
Target::Pipe(pipe) => BufferWriter::pipe(Box::new(Mutex::new(pipe)), color_choice),
};

Writer { inner: writer }
Expand Down

0 comments on commit 6f31706

Please sign in to comment.