Skip to content

Commit 6f31706

Browse files
committed
fix(fmt): Fix passing of WriteStyle when using Target::Pipe
1 parent 8f4361b commit 6f31706

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/fmt/writer/buffer.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,13 @@ impl BufferWriter {
3131
}
3232
}
3333

34-
pub(in crate::fmt::writer) fn pipe(pipe: Box<Mutex<dyn io::Write + Send + 'static>>) -> Self {
34+
pub(in crate::fmt::writer) fn pipe(
35+
pipe: Box<Mutex<dyn io::Write + Send + 'static>>,
36+
write_style: WriteStyle,
37+
) -> Self {
3538
BufferWriter {
3639
target: WritableTarget::Pipe(pipe),
37-
write_style: WriteStyle::Never,
40+
write_style,
3841
}
3942
}
4043

src/fmt/writer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl Builder {
138138
let writer = match mem::take(&mut self.target) {
139139
Target::Stdout => BufferWriter::stdout(self.is_test, color_choice),
140140
Target::Stderr => BufferWriter::stderr(self.is_test, color_choice),
141-
Target::Pipe(pipe) => BufferWriter::pipe(Box::new(Mutex::new(pipe))),
141+
Target::Pipe(pipe) => BufferWriter::pipe(Box::new(Mutex::new(pipe)), color_choice),
142142
};
143143

144144
Writer { inner: writer }

0 commit comments

Comments
 (0)