Skip to content

Commit

Permalink
Merge pull request #302 from Bobo1239/main
Browse files Browse the repository at this point in the history
fix(fmt): Fix passing of WriteStyle when using Target::Pipe
  • Loading branch information
epage committed Jan 27, 2024
2 parents 8f4361b + 6f31706 commit 489ba18
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 489ba18

Please sign in to comment.