Skip to content

Commit 489ba18

Browse files
authored
Merge pull request #302 from Bobo1239/main
fix(fmt): Fix passing of WriteStyle when using Target::Pipe
2 parents 8f4361b + 6f31706 commit 489ba18

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy